PHP Classes

File: sample-latlng-2-address.php

Recommend this page to a friend!
  Classes of Vinsensius Angelo   Geocoder Google   sample-latlng-2-address.php   Download  
File: sample-latlng-2-address.php
Role: Example script
Content type: text/plain
Description: Example Latitude-Longitude to Address
Class: Geocoder Google
Get the coordinates of an address with Google Maps
Author: By
Last change:
Date: 12 years ago
Size: 614 bytes
 

Contents

Class file image Download
<?php
error_reporting
(E_ALL);
ini_set("display_errors","1");
require
"google-geocode.php";
$geoCode = new Geocoder_google();
$latlng="35.20621,-111.637246";
$result = $geoCode->getCoordinateLocation($latlng);
$resultInfo = $geoCode->getCoordinateInfo($latlng);
echo
"result for &ldquo;$latlng&rdquo; (method : ".$geoCode->requestmethod.") : <br>";
if(!empty(
$result)){
    echo
"<pre>";
   
print_r($result);
   
"</pre>";
}
else{
    echo
"can't retrieve result";
}

echo
"<hr>";
if(!empty(
$result)){
    echo
"<pre>";
   
print_r($resultInfo);
    echo
"</pre>";
}
else{
    echo
"can't retrieve info";
}

?>