Handle Gestures
Hello, how I can handle gestures from mapview?
Which platform are you using the map view on?
iOS
MGLMapView handles standard gestures (swipe to pan, pinch to zoom, rotate with two fingers, etc.) by default. If you need to handle additional gestures, UIKit provides a set of gesture recognizer classes like UILongPressGestureRecognizer that help you handle gestures with minimal extra code.
Does this answer your question?
what is the best way to avoid conflicts between mapbox gestures and my personal implementation with gesture recogniser?
If you’re looking to replace one of the built-in gestures, you can disable that gesture by setting rotateEnabled, scrollEnabled, or zoomEnabled to false. Otherwise, what kind of conflict are you trying to work around?
@crazyBoat you can implement the gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: method in the UIGestureRecognizerDelegate protocol to allow your gesture recognizer to pass through to the MGLMapView ones without interfering.
Even after implementing gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: set to true, the pan gesture is not passing through to the map view.
The suggestion in https://github.com/mapbox/mapbox-gl-native/issues/1758#issuecomment-114250985 was to use this method to intercept the gestures you don't want MGLMapView handling. Unconditionally returning true will always allow both gesture recognizers to fire simultaneously, which is probably not your intent.
Related: #2278.