PHP Classes
elePHPant
Icontem

File: sample-address-2-latlng.php

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

Contents

Class file image Download
<?php
error_reporting
(E_ALL);
ini_set("display_errors","1");
require
"google-geocode.php";
$geoCode = new Geocoder_google();
$address = "columbus,ohio";
$result = $geoCode->getLocationCoordinate($address);
$resultInfo = $geoCode->getLocationInfo($address);

echo
"result for &ldquo;$address&rdquo; (method : ".$geoCode->requestmethod.") : <br>";
if(
is_array($result)){
    echo
"<pre>";
   
print_r($result);
   
"</pre>";
}
else{
    echo
"can't retrieve result";
}
echo
"<hr>";
if(
is_array($resultInfo)){
    echo
"<pre>";
   
print_r($resultInfo);
    echo
"</pre>";
}
else{
    echo
"can't retrieve info";
}

?>