html - 一个好的 google.maps 地理定位 api?

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

<分区>

是否有 google maps api 允许您传入位置名称并返回指向 googlemaps 上的位置的坐标?

最佳答案

这是 The Google Geocoding API

这是一个示例请求:

http://maps.googleapis.com/maps/api/geocode/xml?address=Berlin&sensor=false

您可以过滤结果:geometry/location/latlng

<GeocodeResponse>
  <status>OK</status>
    <result>
    <type>locality</type>
    <type>political</type>
    <formatted_address>Berlin, Deutschland</formatted_address>
    […]
    <geometry>
      <location>
        <lat>52.5234051</lat>
        <lng>13.4113999</lng>
      </location>
      <location_type>APPROXIMATE</location_type>
      <viewport>[…]</viewport>
      <bounds>[…]</bounds>
    </geometry>
  </result>
</GeocodeResponse>

关于html - 一个好的 google.maps 地理定位 api?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6697724/

相关文章:

java - 从网站本地化手机(获取经度和纬度)的最佳方法是什么?

php - 如何通过IP地址获取国家代码和货币代码?

html - 将三个 div 居中放置在一个更大的 div 中,左右边距相同

php - 如何避免机器人对表单的攻击

javascript - HTML5获取地理位置功能

javascript - ESLint 禁止使用警报(无警报)

C - 如何在 linux 中使用 API 库

api - 使用 ffmpeg API : bigger filesize than ffmpeg. exe 进行 MPEG-2 视频编码

javascript - 不在 html 页面上显示来自 API 的值,而是加载 JSON

java - objectify 中的附近搜索