From a5e34a2bc829d35bb946c2a53d3b1459cc9e05e0 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Mon, 10 Aug 2015 15:50:25 -0400 Subject: [PATCH] [ios] Don't disable user tracking on `setDirection:` or quick zoom gesture --- platform/ios/MGLMapView.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 3b86c7b98..64f8d0f69 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -1371,8 +1371,6 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) self.scale = _mbglMap->getScale(); self.quickZoomStart = [quickZoom locationInView:quickZoom.view].y; - - self.userTrackingMode = MGLUserTrackingModeNone; } else if (quickZoom.state == UIGestureRecognizerStateChanged) { @@ -1772,7 +1770,10 @@ mbgl::LatLngBounds MGLLatLngBoundsFromCoordinateBounds(MGLCoordinateBounds coord { if ( ! animated && ! self.rotationAllowed) return; - self.userTrackingMode = MGLUserTrackingModeNone; + if (self.userTrackingMode == MGLUserTrackingModeFollowWithHeading) + { + self.userTrackingMode = MGLUserTrackingModeFollow; + } CGFloat duration = (animated ? MGLAnimationDuration : 0);