Localization on Geocoder results

1,017 views
Skip to first unread message

Sheepz

unread,
Mar 25, 2010, 2:50:57 PM3/25/10
to Google Maps JavaScript API v3, g...@xtify.com
Hi all,
I've been searching the forums for information about localization and
found that on October of 2009 there was talk about implementing it in
the API, but no talk on whether or not it was actually realized.
My problem is the following, when I do a query on a US address, I get
the correct results and everything works fine, but when I try to
geocode an address outside of the US, I get results in the native
language, for example, when searching for KYOTO, I
get:formatted_address:日本, 京都府京都市 and when I search for Ben Gurion
Airport in Israel I get: formatted_address:مطار بن غوريون الدولي
(Arabic for some reason), either way, this is not good for me because
I need to store it in my DB and be able to query by it and would
therefore prefer it all to be in English, and looking at
maps.google.com, when I do my searches there, I do indeed get English
results, so my question is how can I make the geocoder also return my
results in English?
I've tried adding parameters to the import (e.g.
http://maps.google.com/maps/api/js?sensor=false&language=en&region=US)
but to no avail, is there anything else I can try, or is this just the
way it is?
Thanks in advance,
Elad.

Marcelo

unread,
Mar 26, 2010, 4:04:32 AM3/26/10
to Google Maps JavaScript API v3
On Mar 25, 7:50 pm, Sheepz <eladk...@gmail.com> wrote:
> I've tried adding parameters to the import (e.g.http://maps.google.com/maps/api/js?sensor=false&language=en&region=US)

That's the line that loads the API, and there's no region parameter
specified for it.

Did you read the documentation about the geocoder?
Client side:
http://code.google.com/apis/maps/documentation/geocoding/index.html
Server side:
http://code.google.com/apis/maps/documentation/v3/services.html#Geocoding

Server side in English (default):
http://maps.google.com/maps/api/geocode/xml?address=jerusalem&sensor=false
http://maps.google.com/maps/api/geocode/xml?address=ben%20gurion%20airport&sensor=false

Server side in Hebrew:
http://maps.google.com/maps/api/geocode/xml?address=jerusalem&sensor=false&language=he
http://maps.google.com/maps/api/geocode/xml?address=ben%20gurion%20airport&sensor=false&language=he


If that doesn't help then please follow the posting guidelines and
post a link to your map demonstrating the problem.

--
Marcelo - http://maps.forum.nu
--

Marcelo

unread,
Mar 26, 2010, 12:52:56 PM3/26/10
to Google Maps JavaScript API v3
On Mar 26, 9:04 am, Marcelo <marcelo...@hotmail.com> wrote:
>
> That's the line that loads the API, and there's no region parameter
> specified for it.

Sorry, I was mistaken! There is a region parameter when loading the
API, but it will only *bias* the geocoding results, not restrict them
to a certain country.
The safest way to restrict results to a country is to add the country
name to the query string.

--
Marcelo - http://maps.forum.nu
--


>


> Did you read the documentation about the geocoder?
> Client side:http://code.google.com/apis/maps/documentation/geocoding/index.html

> Server side:http://code.google.com/apis/maps/documentation/v3/services.html#Geoco...
>
> Server side in English (default):http://maps.google.com/maps/api/geocode/xml?address=jerusalem&sensor=...http://maps.google.com/maps/api/geocode/xml?address=ben%20gurion%20ai...
>
> Server side in Hebrew:http://maps.google.com/maps/api/geocode/xml?address=jerusalem&sensor=...http://maps.google.com/maps/api/geocode/xml?address=ben%20gurion%20ai...


>
> If that doesn't help then please follow the posting guidelines and
> post a link to your map demonstrating the problem.
>
> --

> Marcelo -http://maps.forum.nu

Reply all
Reply to author
Forward
0 new messages