-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Animating map view contraints is jerky; implicit animation via Core Animation properties not supported #4352
Comments
+1 |
Is there a workaround? |
I’m not sure about a workaround, but I suspect the problem may be that |
The fix is probably to move the call to |
Ok, do you know when this will be fixed? |
Looking for this as well. |
Closing due to ticket age. If this is still a problem, please re-open |
@friedbunny I'm also having this issue and would appreciate an update. Are there any workarounds? |
As a possible starting point, we should check whether mapbox-gl-native/platform/ios/src/MGLMapView.mm Lines 615 to 616 in d5f0e4b
|
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
This is still an issue that I've been following and hoping for a resolution. I hope you'll consider re-opening it. The best workaround that I've come up with is to leave the size of the mapview unchanged, and change the content insets of the map (which adjusts the coordinates bounds and center of the map). The map animation happens after the second view has been finished animating so you lose the effect you see above where they both animate together. This significantly degrades the experience as it has become a very common mobile UI pattern with all the major map apps. |
This is still open @katiesmillie! Your workaround of changing the content insets may actually be part of the solution that we're looking at (or similar) - since adjusting the frame buffers during an animation gives poor performance. |
+1 for this issue |
The same issue is also happening when the iOS tab bar or Navigation Bar are showing animated. as the container of the map will change constrains animated. I also noticed that changing the content inset (animated if I remember correctly) also does not redraw the current location annotation position (as originally reported) |
The root cause of the original report is that |
Replacing GLKView with a built-in Core Animation layer (#14785) would make the effect somewhat less jarring, as it is on macOS. The layer’s frame would animate correctly, though the content could potentially stretch or compress to fit that frame during the animation. Supporting implicit animation is the correct fix no matter what. |
@1ec5 Would it be possible and is the idea to support animation for the camera and centerCoordinate etc? We noticed that changing the inset/frame of the map while zooming the camera will: trigger
which calls |
Yes, I think implicit animation of these properties is essentially what this issue tracks. There is a separate effort to overhaul the camera APIs on both Android and iOS/macOS, which is sort of tracked in #9808, but I think we have to solve this issue regardless, especially considering the prominence of implicit animation in SwiftUI. |
Hi, I am getting same issue in iOS. Is there any solution to fix it? Please advise. @1ec5 |
The proper way to animate MGLMapView is to modify its auto layout constraints (and not the frame), but this doesn’t behave correctly:
Preview of the test project:
/cc @1ec5 @boundsj
The text was updated successfully, but these errors were encountered: