Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Programmatic animations fail to recalculate zoom-dependent properties #2946

Closed
johnnewman opened this issue Nov 5, 2015 · 3 comments
Closed
Assignees
Labels
bug iOS Mapbox Maps SDK for iOS
Milestone

Comments

@johnnewman
Copy link

Animating a region change sometimes doesn't redraw the map's streets/text for the correct level. When zoomed into Chicago and animating to the state of New York, the map initially renders like below:

newyork1

After slightly pinch zooming, the map will redraw itself at the correct level:

newyork2

This happens when calling setCenterCoordinate:zoomLevel:animated: with YES for animated. We've seen it on v2.1.2 and v3.0.0-pre4.

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS labels Nov 5, 2015
@1ec5
Copy link
Contributor

1ec5 commented Nov 5, 2015

This would be caused by MGLMapView issuing an update() of type Update::Render instead of Update::Zoom.

/cc @incanus @jfirebaugh

@1ec5
Copy link
Contributor

1ec5 commented Nov 5, 2015

Reproduces with the following code:

[self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(41.87542, -87.62497) zoomLevel:18 animated:NO];

then:

[self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(42.908, -75.388) zoomLevel:6 animated:YES];

@1ec5
Copy link
Contributor

1ec5 commented Nov 5, 2015

-setCenterCoordinate:zoomLevel:animated: uses easeTo(), which does use Update::Zoom at every step along the way, just like the pinch gesture recognizer. So I’m not sure what’s missing.

@1ec5 1ec5 added this to the ios-v3.0.0 milestone Nov 5, 2015
@1ec5 1ec5 changed the title iOS GL - Animating region change can cause map to draw incorrect details Programmatic animations fail to recalculate zoom-dependent properties Nov 5, 2015
1ec5 added a commit that referenced this issue Nov 5, 2015
The final frame is self-destructing – it destroys the frame and finish functions – so technically we’re no longer inTransition(). Yet there still needs to be an update after that final frame.

Fixes #2946.
@1ec5 1ec5 self-assigned this Nov 5, 2015
1ec5 added a commit that referenced this issue Nov 6, 2015
The final frame is self-destructing – it destroys the frame and finish functions – so technically we’re no longer inTransition(). Yet there still needs to be an update after that final frame.

Also, avoid a redundant change notification on the last frame. (It would come too late, after the DidChange notification, anyhow.)

Fixes #2946.
@1ec5 1ec5 closed this as completed in #2951 Nov 6, 2015
@1ec5 1ec5 removed the ready label Nov 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

No branches or pull requests

2 participants