Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit bc845b9

Browse files
authored
[ios] Limit annotation view pan gesture check to own recognizer (#5813)
Allows non-dragging pans that are initiated on views to pan the underlying map. Annotation views each have long press and pan gesture recognizers. If a view is not draggable or not in a positive dragging state, the pan gesture recognizer should not begin. This commit makes the criteria for rejecting pans more strict — only `_panGestureRecognizer` should be rejected, not the entire `UIPanGestureRecognizer` class.
1 parent 850b2e2 commit bc845b9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

platform/ios/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON
55
## 3.3.2
66

77
* Fixed a crash that occurred when initializing an MGLMapView on iOS 8.1 or below. ([#5791](https://github.com/mapbox/mapbox-gl-native/pull/5791))
8+
* Fixed an issue where pan gestures that originated on view annotations would not pan the underlying map. ([#5813](https://github.com/mapbox/mapbox-gl-native/pull/5813))
89

910
## 3.3.1
1011

platform/ios/src/MGLAnnotationView.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
235235
{
236236
BOOL isDragging = self.dragState == MGLAnnotationViewDragStateDragging;
237237

238-
if ([gestureRecognizer isKindOfClass:UIPanGestureRecognizer.class] && !(isDragging))
238+
if (gestureRecognizer == _panGestureRecognizer && !(isDragging))
239239
{
240240
return NO;
241241
}

0 commit comments

Comments
 (0)