【问题标题】:How to get the GMSMarker which are inside the GMSPolygon如何获取 GMSPolygon 内的 GMSMarker
【发布时间】:2016-05-17 09:42:23
【问题描述】:

我正在使用 google maps api 在我的 ios 应用程序中将多边形绘制到地图中,我通过这个链接实现了这个免费的手绘多边形: https://github.com/saru2020/SARMapDrawView 所以现在我有一个 GMSPolygon 但我想得到位于多边形内的 GMSMarker。 如果我们想获取屏幕中的标记,我们可以这样做:Google Maps for iOS - How can you tell if a marker is within the bounds of the screen? 所以我想知道是否有任何方法可以只获取多边形内的标记。

【问题讨论】:

标签: ios google-maps gmsmapview


【解决方案1】:

我知道这是旧的,但我使用它。

if GMSGeometryContainsLocation(marker.position, polygonPath, true){
   //marker is within the polygon based on the polygon.path 
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多