Google Map Search

23 views
Skip to first unread message

Speedy

unread,
Oct 13, 2011, 4:42:49 AM10/13/11
to google-map...@googlegroups.com

Hi,

I'm using Google's Geocoder to find lat lng coordinates for a given address.
 
address variable is taken from an input field.
 

Now my application requirement is I must restrict the search in locations UK, UAE, Oman, Ireland, and Egypt.

To achieve that goal first I was trying to control the search to UK, and specified 'region':'uk' but it is not working for me.

When I type in "Boston" it's finding Boston in US and I wanted the one in UK.

How to restrict Geocoder to return locations only from those countries?

Thanks

Esa

unread,
Oct 14, 2011, 2:44:05 PM10/14/11
to Google Maps JavaScript API v3
A very interesting problem. I been succesfully limiting geocoding for
a single country, but multiple countries hmmm...

You can adjust the request and you can filter the request. However
your example of "Boston" returns the six first "Bostons" in the World,
all of them in US. So you cannot get anything useful by filtering the
results, you have to make the query more intelligent.

Syntax for that kind of query is not published.

All the help that I can provide at this point, is an old test page
that prints the full geocoder response.
http://koti.mbnet.fi/ojalesa/geocode/prettygeocode_v3.htm

(tested only with FF)

Esa

unread,
Oct 14, 2011, 2:47:22 PM10/14/11
to Google Maps JavaScript API v3
Of course I meant that:

You can adjust the request and you can filter the _response_.
Reply all
Reply to author
Forward
0 new messages