[ios] snap to north if interaction ends within ±7°
First proposed in #938, implemented in #1059, reverted in #1064.
This commit is contained in:
@@ -45,6 +45,7 @@ Known issues:
|
||||
- MGLMapCamera’s `altitude` values now match those of MKMapCamera. ([#3362](https://github.com/mapbox/mapbox-gl-native/pull/3362))
|
||||
- The user dot’s callout view is now centered above the user dot. It was previously offset slightly to the left. ([#3261](https://github.com/mapbox/mapbox-gl-native/pull/3261))
|
||||
- Fixed an issue with small map views not properly fitting annotations within bounds. (#[3407](https://github.com/mapbox/mapbox-gl-native/pull/3407))
|
||||
- The map will now snap to north. ([#3403](https://github.com/mapbox/mapbox-gl-native/pull/3403))
|
||||
|
||||
## iOS 3.0.1
|
||||
|
||||
|
||||
@@ -3027,6 +3027,8 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration)
|
||||
//
|
||||
- (void)unrotateIfNeededAnimated:(BOOL)animated
|
||||
{
|
||||
double snapTolerance = 7;
|
||||
|
||||
// don't worry about it in the midst of pinch or rotate gestures
|
||||
//
|
||||
if (self.pinch.state == UIGestureRecognizerStateChanged || self.rotate.state == UIGestureRecognizerStateChanged) return;
|
||||
@@ -3057,6 +3059,10 @@ std::chrono::steady_clock::duration MGLDurationInSeconds(float duration)
|
||||
[self resetNorthAnimated:NO];
|
||||
}
|
||||
}
|
||||
else if (self.direction < snapTolerance || self.direction > 360 - snapTolerance)
|
||||
{
|
||||
[self resetNorthAnimated:animated];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)notifyMapChange:(mbgl::MapChange)change
|
||||
|
||||
Reference in New Issue
Block a user