javascript 使用谷歌地图地理编码器反向获取城市名称的简单功能

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8978996/
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-26 05:12:05  来源:igfitidea点击:

Simple function to get city name with Google Maps geocoder reverse

javascripthtmlgoogle-mapsgoogle-maps-api-3

提问by Nacho Sarmiento

I am creating a small application using HTML 5, Javascript and Google Maps API but I need to do a function to reverse geolocation. I give the latitude and longitude, and show the city where I am.

我正在使用 HTML 5、Javascript 和 Google Maps API 创建一个小型应用程序,但我需要执行一个函数来反向定位。我给出纬度和经度,并显示我所在的城市。

The code to generate the map I have is set up, I just need a simple function of reverse geolocation

生成地图的代码我已经设置好了,我只需要一个简单的反向地理定位功能

If anyone can help I would be very grateful.

如果有人可以提供帮助,我将不胜感激。