Repository navigation
[ios] snap to north if interaction ends within ±7° - #3403
Conversation
|
Going to leave this convenient - (void)mapViewRegionIsChanging:(__unused MGLMapView *)mapView
{
[self updateDirectionDebug];
}
- (void)mapView:(__unused MGLMapView *)mapView regionDidChangeAnimated:(__unused BOOL)animated
{
[self updateDirectionDebug];
}
- (void)updateDirectionDebug
{
if (! _directionDebug)
{
_directionDebug = [[UILabel alloc] initWithFrame:CGRectMake(250, 100, 100, 50)];
[self.view addSubview:_directionDebug];
}
_directionDebug.text = [NSString stringWithFormat:@"%.2f", self.mapView.direction];
} |
|
Could this be done as part of |
|
I'm looking into integrating it in |
|
I went ahead and integrated the snapping with I've not copied the delayed animations and disabled user interaction that exists just above in |
There was a problem hiding this comment.
What if the developer hides the compass view? Shouldn’t the map view snap to north regardless?
There was a problem hiding this comment.
Good point, will look at changing this.
|
Ergh, accidentally included iosapp debug code. Will back that out. |
4f2c56c to
e4d8494
Compare
|
Rebased and squashed. |
If a user pinch-rotates and the gesture ends within ±7° of north, reset to north (0°).
This behavior is the same as in MapKit.
First proposed in #938, implemented in #1059, reverted in #1064. (Closes #1064.)
/cc @1ec5