[core, ios, osx] Tilt around visual center point
The tilt gesture on both iOS and OS X now respects the content insets. On iOS, in user tracking mode, it additionally respects the user dot’s position if it’s aligned to the top or bottom of the view.
This commit is contained in:
committed by
Minh Nguyễn
parent
97fc2120c4
commit
8a23bdcd01
@@ -1428,8 +1428,13 @@ mbgl::Duration MGLDurationInSeconds(NSTimeInterval duration)
|
||||
CGFloat slowdown = 20.0;
|
||||
|
||||
CGFloat pitchNew = currentPitch - (gestureDistance / slowdown);
|
||||
|
||||
_mbglMap->setPitch(pitchNew);
|
||||
|
||||
CGPoint centerPoint = self.contentCenter;
|
||||
if (self.userTrackingMode != MGLUserTrackingModeNone)
|
||||
{
|
||||
centerPoint = self.userLocationAnnotationViewCenter;
|
||||
}
|
||||
_mbglMap->setPitch(pitchNew, centerPoint);
|
||||
|
||||
[self notifyMapChange:mbgl::MapChangeRegionIsChanging];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user