Google MAP API or Other!

I want to use Google MAP API or something alike for searching address,city and zip codes, not for showing a map because the website I am intending to do is for delivering goods for a wide area. The problem is it’s so hard and takes long time to gather street names , numbers, and zip codes and they are alot.

for example:

<input type="text" name="drop-off"  id="drop"  style="color:#666666"/>

the customer will enter like this in the texe field : 10 Abbe…, then autmatically the address appear like this for example 10 abbey st and ect.

Is it possible to make it with Google MAP API or there are many other things for this issue?

Thanks in Advance!

If you want to find matching addresses, without necessarily displaying them on a map, try looking at the Google Geocode stuff.

You could, for example, use cURL to fetch JSON encoded data from Google:


$url = 'http://maps.google.com/maps/api/geocode/json?sensor=false&language=en&address='.urlencode($_REQUEST['drop-off']);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
$response = curl_exec($ch);
curl_close($ch);

$response = json_decode($response);

if($response->status=='OK') {
    // do stuff with the results
} else {
    // tell the user there's an error
}

If you want the results to appear directly in the browser, you’ll need to set up some Ajax trickery.

Thanks Immerse for the reply. You know, it’s kinda complicated for setting it up on a website. If you don’t mind give more explaination or guide me to set it up!