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

571 Views Asked by At

How to detect the single tap on the map view, I did not find any function for this in MGLMapViewDelegate.

1

There are 1 best solutions below

0
On BEST ANSWER

Finally, I found a way to detect it. I write a subclass of the MGLMapView and override the touchEnded function. When you tap on the annotations it only called the touchBegin function. when touching on the map view it called both touchBegin and touchEnded. When touching on the polyline or polygon, it will call the delegate function didSelectAnnotations.