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

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

问题描述

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

有人可以告诉我如何使用地图的地理编码器以两种或多种不同语言获取城市名称吗?

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

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

推荐答案

似乎该功能已被移除:

我们进行了此更改以简化 API.地理编码器使用浏览器的首选语言,或加载 API 时指定的语言"(来源)

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

直接使用还是可以的:

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天全站免登陆