javascript 将坐标转换为地名

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3641984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 01:48:57  来源:igfitidea点击:

Convert coordinates to a place name

javascripthtmlgeolocationgoogle-maps-api-3

提问by Vinzcent

I am using the HTML5 Geolocation API to find the longitude and the latitude from the users of my site. This works, but now I would like to show on the screen "You currently are in ...". So I need to convert these coordinates I get from the Geolocation API to a place name.

我正在使用 HTML5 Geolocation API 从我的网站的用户那里找到经度和纬度。这有效,但现在我想在屏幕上显示“你目前在......”。因此,我需要将从 Geolocation API 获得的这些坐标转换为地名。

I tried a bit with Google Maps API, but I didn't get it working.

我尝试了一些 Google Maps API,但没有成功。

Does anyone knows how to do this?

有谁知道如何做到这一点?

回答by Pekka

The Google Maps API Docshave what seems to be a complete reverse geocoding example. (Note that this is the new V3 API!)

谷歌地图API文档有什么似乎是一个完整的反向地理编码例子。(请注意,这是新的 V3 API!)