0

我试图获取在谷歌中显示的区域的顶点。我如何获得谷歌地图中定义区域/区域的顶点

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

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

而这里是英国肯特地区:

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

在这两个区域都被Google识别并在地图上显示为多边形。

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

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

我该怎么做?

回答

0

只有在使用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 
     } 
    } 
    } 
相关问题