From 48e17724a12601ebd76009990bc46f82519b1a76 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 13 Mar 2017 12:45:17 -0400 Subject: [PATCH] [ios] Enable one-finger quickzoom gesture on iPad --- platform/ios/CHANGELOG.md | 1 + platform/ios/src/MGLMapView.mm | 13 +++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/platform/ios/CHANGELOG.md b/platform/ios/CHANGELOG.md index 6ffad0af1..1b76470e6 100644 --- a/platform/ios/CHANGELOG.md +++ b/platform/ios/CHANGELOG.md @@ -49,6 +49,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT * Fixed an issue where translucent, non-view-backed point annotations along tile boundaries would be drawn darker than expected. ([#6832](https://github.com/mapbox/mapbox-gl-native/pull/6832)) * Double-tap and two-finger tap gestures now zoom to the nearest integer zoom level. ([#8027](https://github.com/mapbox/mapbox-gl-native/pull/8027)) * The `MGLAnnotationView.annotation` property is now read-write. ([#8139](https://github.com/mapbox/mapbox-gl-native/pull/8139)) +* Enabled the one-finger zoom gesture on iPad. To execute this gesture, tap twice; on second tap, hold your finger on the map and pan up to zoom in, or down to zoom out ([#8379](https://github.com/mapbox/mapbox-gl-native/pull/8379)) ### Networking and offline maps diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 2333df5c9..1baebf60b 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -540,14 +540,11 @@ public: _decelerationRate = MGLMapViewDecelerationRateNormal; - if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) - { - _quickZoom = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleQuickZoomGesture:)]; - _quickZoom.numberOfTapsRequired = 1; - _quickZoom.minimumPressDuration = 0; - [_quickZoom requireGestureRecognizerToFail:doubleTap]; - [self addGestureRecognizer:_quickZoom]; - } + _quickZoom = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleQuickZoomGesture:)]; + _quickZoom.numberOfTapsRequired = 1; + _quickZoom.minimumPressDuration = 0; + [_quickZoom requireGestureRecognizerToFail:doubleTap]; + [self addGestureRecognizer:_quickZoom]; // observe app activity //