2008-11-24 39 views
2

我使用谷歌AJAX API加载程序,并希望得到在德国 的所有信息,所以我载入Maps API,这样谷歌地图的地理编码总是使用浏览器语言

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

我已经试过申,ger,de,de_DE甚至en和ja_JP但是没有成功。

对于那些谁不明白我的问题: http://dl.getdropbox.com/u/5910/Jing/2008-11-24_2018.png你可以在http://apps.komola.de/gmaps.htm尝试地址是英语对英语的浏览器和德国在德国的浏览器

回答

3

此API文档显示地图本地化的局限性http://code.google.com/apis/maps/documentation/#Localization

该语言似乎只是影响接口(按钮等),base_domain会影响它使用的服务。所以base_domain强制它使用google.de作为地理编码服务。

<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> 

loader doc提到了base_domain。 http://code.google.com/apis/ajax/documentation/#GoogleLoad

+0

不适用于我:(我正在使用英文客户端(Firefox),但德国的IE显示它在德语,如果我说语言:'en'它仍然显示我的德国回应 – Thomaschaaf 2008-11-24 14:48:01