【问题标题】:How do I get the vertices of a defined area / region in google maps如何在谷歌地图中获取定义区域/区域的顶点
【发布时间】:2017-07-25 16:00:44
【问题描述】:

我正在尝试获取在 google 中显示的区域的顶点。

例如这里是阿根廷布宜诺斯艾利斯的“Piñeiro”地区:

https://www.google.com.ar/maps/place/Piñeiro,+Provincia+de+Buenos+Aires/

这里是英国肯特郡的地区:

https://www.google.co.uk/maps/place/Kent,+UK/

在这两个区域中,谷歌都可以识别并在地图上显示为多边形。

我想获得该多边形的顶点,而不必自己手动定义或复制它。

我要查找的信息是定义多边形的 LatLng 坐标列表。

我该怎么做?

【问题讨论】:

    标签: google-maps google-maps-api-3 polygon reverse-geocoding vertices


    【解决方案1】:

    多边形仅在使用 Google 地图时显示。它们不能通过 Google Maps API 或 Google Places API 获得。

    如果您在此处查看响应格式:https://developers.google.com/places/web-service/details#PlaceDetailsResponses。几何对象只包含位置坐标和视口。

    "geometry" : {
         "location" : {
            "lat" : -33.866651,
            "lng" : 151.195827
         },
         "viewport" : {
            "northeast" : {
               "lat" : -33.8653881697085,
               "lng" : 151.1969739802915
            },
            "southwest" : {
               "lat" : -33.86808613029149,
               "lng" : 151.1942760197085
            }
         }
      }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-12
      • 1970-01-01
      • 1970-01-01
      • 2017-08-21
      • 2014-05-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多