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

Commit

Permalink
[ios] Limit annotation view pan gesture check to own recognizer (#5813)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
friedbunny authored Jul 28, 2016
1 parent 850b2e2 commit bc845b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CON
## 3.3.2

* 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))
* 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))

## 3.3.1

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/src/MGLAnnotationView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
BOOL isDragging = self.dragState == MGLAnnotationViewDragStateDragging;

if ([gestureRecognizer isKindOfClass:UIPanGestureRecognizer.class] && !(isDragging))
if (gestureRecognizer == _panGestureRecognizer && !(isDragging))
{
return NO;
}
Expand Down

0 comments on commit bc845b9

Please sign in to comment.