summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/ios/src/MGLMapView.mm9
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm
index 2c10a606c0..1483d72074 100644
--- a/platform/ios/src/MGLMapView.mm
+++ b/platform/ios/src/MGLMapView.mm
@@ -1968,9 +1968,11 @@ public:
[self cancelTransitions];
self.cameraChangeReasonBitmask |= MGLCameraChangeReasonGestureTilt;
-
+ static CGFloat initialPitch;
+
if (twoFingerDrag.state == UIGestureRecognizerStateBegan)
{
+ initialPitch = self.mbglMap.getPitch();
[self trackGestureEvent:MMEEventGesturePitchStart forRecognizer:twoFingerDrag];
[self notifyGestureDidBegin];
}
@@ -1978,10 +1980,9 @@ public:
if (twoFingerDrag.state == UIGestureRecognizerStateBegan || twoFingerDrag.state == UIGestureRecognizerStateChanged)
{
CGFloat gestureDistance = CGPoint([twoFingerDrag translationInView:twoFingerDrag.view]).y;
- CGFloat currentPitch = self.mbglMap.getPitch();
- CGFloat slowdown = 20.0;
+ CGFloat slowdown = 2.0;
- CGFloat pitchNew = currentPitch - (gestureDistance / slowdown);
+ CGFloat pitchNew = initialPitch - (gestureDistance / slowdown);
CGPoint centerPoint = [self anchorPointForGesture:twoFingerDrag];