Google Maps API v3.5 Geocoder语言选项 [英] Google Maps API v3.5 Geocoder language option

查看:150
本文介绍了Google Maps API v3.5 Geocoder语言选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google Maps API根据用户的坐标以2种不同语言获取城市名称。在版本3.5的API之前,我可以在地理编码器的请求中使用语言选项,但自2011年6月8日起,此选项被删除。



有人可以给我任何想法如何使用地图地理编码器以两种或更多不同语言获取城市名称?



我包含了带有语言选项的js脚本,就像这样 - http://maps.google.com/maps/api/js?sensor=false&language=ja

解决方案

看来该功能已被删除:


API。 Geocoder使用浏览器的首选语言或加载API时指定的语言(来源


直接使用它仍然有效:

http://maps.googleapis。 com / maps / api / geocode / json?latlng = 40.714224,-73.961452& sensor = false& language = ja

http://maps.googleapis.com/maps/api/geocode/ json?latlng = 40.714224,-73.961452& sensor = false& language = en

I use Google Maps API to get city name in 2 different languages by users' coordinates. Before version 3.5 of the API I was able to use language option in geocoder's request, but since June 8, 2011 this option is removed.

Can someone give me any idea how can I get the city name in two or more different languages with maps' geocoder?

I included the js script with language option something like this - http://maps.google.com/maps/api/js?sensor=false&language=ja

解决方案

It seems that the feature has been removed:

We made this change to simplify the API. The Geocoder uses the browser's preferred language, or language specified when loading the API" (Source)

It still work if used directly:

http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false&language=ja

http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=false&language=en

这篇关于Google Maps API v3.5 Geocoder语言选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆