【问题标题】:How to geocode location to get it's coordinates?如何对位置进行地理编码以获取其坐标?
【发布时间】:2017-10-26 22:54:55
【问题描述】:

我想在 HTML 页面中使用谷歌地图时获取一个地址的纬度和经度坐标,这是一个虚拟值。然后我想根据计算出的坐标显示位置。如何使用 HTML、JavaScript 和 Google 地图实现此功能?

【问题讨论】:

标签: google-maps google-maps-api-3 geolocation


【解决方案1】:

https://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=YOUR_API_KEY 在这里这个 url 你可以得到坐标。通过请求它,我们获得了响应数据,其中我们获得了 JSON 格式的坐标。欲知详情https://developers.google.com/maps/documentation/geocoding/intro

这里是使用 google map url 显示位置的 url https://www.google.com/maps?q={经度},{纬度}

https://stackoverflow.com/a/5807150/8631999

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-16
    • 1970-01-01
    • 1970-01-01
    • 2013-05-06
    相关资源
    最近更新 更多