I wan't to reverse geocode and get the address in two languages arabic and english so I want to get it in one language then change the language of the API and get the address in the other language, as I can't find a parameter to send to geocoder to determine the language. Any suggestions?
Google Maps on the web: Click the menu in the top left, then click Language and select any language to set it. Google Maps app for Android: Tap your profile picture in the top right, tap Settings > Navigation settings > Voice selection > a language. To also adjust the text language go to Settings > App language.
A language can be selected when you load the API by appending language=XX
to the API URL where XX
is the two-character language code (en
for English, ar
for Arabic, etc.) to the URL in the API call. See http://code.google.com/apis/maps/documentation/javascript/basics.html#Localization for documentation.
This won't let you change it on the fly, and I don't think you can do that. You can try loading the API a second time after getting the initial info you need in one language. But that seems likely to cause problems.
A cleaner way to do it might be to create a separate page that acts as a sort of web service for you. It accepts two parameters: A language code and an address. It loads the API using the language code requested, and reverse geocodes the address, providing the result. Your page would call this web service-like thing twice, once for each language, and then use the results as desired.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With