Google Maps GeoCoding always uses browser language

会有一股神秘感。 提交于 2020-01-02 10:06:47

问题


I am using the google ajax api loader and want to get all the information in german so I am loading the maps api like this

google.load("maps", "2", {language : "de"});

I have tried deu, ger, de, de_DE and even en and ja_JPbut no success.

For those who don't understand my problem: http://dl.getdropbox.com/u/5910/Jing/2008-11-24_2018.png you can try it at http://apps.komola.de/gmaps.htm the address is english on the english browser and german on the german browser


回答1:


This API doc indicates the limitations of the map localization http://code.google.com/apis/maps/documentation/#Localization

The language appears to just affect the interface (buttons etc), base_domain affects which services it uses. So base_domain forces it to use google.de for the geocoding service.

<script src="http://www.google.com/jsapi?key=KEYHERE" type="text/javascript"></script>

<script type="text/javascript">
     google.load("maps", "2",{language: "de",base_domain: 'google.de'});
     ...
</script>

The loader doc mentions the base_domain. http://code.google.com/apis/ajax/documentation/#GoogleLoad



来源:https://stackoverflow.com/questions/314158/google-maps-geocoding-always-uses-browser-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!