Login   Register  
PHP Classes
elePHPant
Icontem

File: Example_GoogleMapsHTTPRequest.zip

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ö. Karatag  >  Karatag Google Maps HTTP Request  >  Example_GoogleMapsHTTPRequest.zip  >  Download  
File: Example_GoogleMapsHTTPRequest.zip
Role: Example script
Content type: text/plain
Description: Example File to get coordinates from Google Maps
Class: Karatag Google Maps HTTP Request
Get coordinates of an address using Google Maps
Author: By
Last change:
Date: 2007-04-05 04:48
Size: 751 bytes
 

Contents

Class file image Download
<?php
// Include the GoogleMapsHTTPRequest class
include_once('./GoogleMapsHTTPRequest.class.php');

$address 'In der Mark 57'// Street
$city 'Bochum';            // City
$country 'Germany';        // Country
$zip '44869';              // Zip-Code, PLZ

/**
 * Paut your Google Maps Api Key Here!
 * If You don't have a Key yet? You can get it here: http://www.google.com/apis/maps/signup.html
 */
$GoogleMapsApiKey 'YOUR-API-KEY';


$ga = new googleRequest($address$city$country$zip);

$ga->setGoogleKey($GoogleMapsApiKey);

$ga->GetRequest();

// You can use the result to place your Mark in the Map
echo '<br />LATITUDE: '.$ga->getVar('latitude');
echo 
'<br />LONGITUDE: '.$ga->getVar('longitude');

?>