Get geo-cordinates from multiple addresses via google map & google local search

July 3rd, 2007 by William Yang

I recent found a very good article on How to retrieve geo-cordinates of an UK address from Google AJAX Search API. In this article  Tom Anthony explained why google map api doesn’t support UK address geo-coding and how to use Google AJAX Search API to retrieve geo-cordinate of an UK Address. How ever this method is restricted to only one address per request.  If there are more than one addresses, you will have a hard time cracking Google’s AJAX Search API. I found its not possible to make more than two requests to GLocalSearch object since Google has made the search process  an AJAX call.  When the cordinates are returned, there is no way to tell which cordinate is which.

The reason I am searching for a way to retrieve multiple addresses are I am working on an AJAX enabled UK Plumber search site. I will need the cordinates to work how far an address is to the searched postcode.

To meet what I need. I made the following.

Address-ajax-geocode-diagramI created a “caller page”, which I will dump some Javascript calls to retrieve cordinates from an array of addresses and an IFRAME, that contained a modified Tom’s script, so it not only calls to retrieve the cordinate from GLocalSearch, but also a call to return the cordinates to the caller page. When all addresses are retrieved, they will be displayed on the google MAP.

.

Leave a Reply