Google Maps API geocoder (V3), how to set language on google.maps.GeocoderResult
Is there any property that I can use in Google Maps geocoder (V3) to dynamically set language in result (google.maps.GeocoderResult
)?. Not using html header scrip tag <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=vi-VN"></script>
for example
var G = new google.maps.Geocoder(); // google geocoder
G.geocode({'location': ll/*, 'language':'vi-VN'*/}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
if (results[0]) {
me.set({'locate':results[0].address_components});
me.set({'address':results[0].formatted_address});
} else {
alert("No res开发者_Python百科ults found");
}
} else {
alert("Geocoder failed due to: " + status);
}
Reason I want to build a region tree to connect point have same region
us
/ \
new york ...
/ \
p1 p2
as shown, p1 and p2 are in the same region 'new-york'
thank you
I believe it used to be possible to do this in v2, but in v3, the choices are browser prefs, language localization via paramater in the API script URL, and region localization which is also via parameter in the API script URL.
If you want to share more information about your use case, it may be possible to come up with a solution/workaround.
精彩评论