I make 2 requests to Google Map API geocoder in different languages:
geocoder.geocode({
'latLng': latlng,
'language': 'en'
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
$address_en.val(results[0].formatted_address);
}
});
geocoder.geocode({
'latLng': latlng,
'language': 'ja'
}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
$address_ja.val(results[0].formatted_address);
}
});
But geocoder use default language in both request.
--- Update: ---
I don’t see language parameter in new API documentation (Reference).
But it existed earlier.
I found it in Changelog:
3.5 June 8, 2011
Noticeable changes:
- Removed GeocoderRequest’s "language" option
Is it possible to do this now?
The google.maps.GeocoderRequest object does not have a language property.
The addresses will be returned by the Geocoder using the browser's preferred language setting, or the language specified when loading the API JavaScript using the language parameter. (For more information, see Localization.)
Source: https://developers.google.com/maps/documentation/javascript/geocoding
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