如何检测地图视图 mapbox 上的单击 iOS SDK

How to detect the single tap on the map view mapbox iOS SDK

如何检测地图视图上的单击,我在 MGLMapView Delegate 中没有找到任何相关函数。

终于找到检测方法了。我编写了 MGLMapView 的子类并覆盖了 touchEnded 函数。当您点击注释时,它只会调用 touchBegin 函数。当触摸地图视图时,它同时调用了 touchBegin 和 touchEnded。当触摸折线或多边形时,它会调用委托函数 didSelectAnnotations.