Need Google Geocoding to return City name in English

♀尐吖头ヾ 提交于 2019-12-06 06:30:38

There seems to be a bit of a chaos in that regard. See this list of Google Geocoding API bug reports.

You are using the old V2 API.

According to this post and my own tests, the new V3 API:

http://maps.google.com/maps/api/geocode/xml?address=Rome&sensor=false&language=en

is more sensitive to the language parameter and translates locality names correctly. I get correct results for language=en (Rome), language=de (Rom) and even language=fi (Rooma)!

However, V3 serves its geocoding results in a different format so you would have to change your parsing considerably (Due to the way addressComponents is structured now, this bugged the heck out of me too).

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