Open flikkr opened 1 month ago
Hi @flikkr, thank you for reaching out! We do lack the timing curve parameter for our animations comparing to native platforms, I've created a ticket to add it on the Flutter side https://mapbox.atlassian.net/browse/MAPSFLT-255.
Meanwhile, you can animate the globe with a series of setCamera()
calls.
Setup an animation with AnimationController
/Ticker
and then in the animation/ticket callback update the map camera with the position interpolated for the current animation progress.
This is a bit more elaborate way than using high-level animations provided by us, but you can customize every aspect of the animation this way.
Thanks for the reply @evil159! Nice to hear that it will be worked on.
Using the method you mentioned, wouldn't I need to call the setCamera
method 60 times per second if I want 60fps animation? That's a lot of native calls, would it affect performance?
Yes, you'd need to set the camera in sync with the current frame drawing frequency(60 is a good starting point), it should have more overhead than calling easeTo()
once per second, but should still be manageable. If you'll experience a big degradation in performance or any other severe issues - don't hesitate to file another issue.
I am trying to recreate this rotating globe animation from the Android and iOS SDK in Flutter, but it seems like there are some missing parameters in the
MapAnimationOptions
class, notablyInterpolator
for indicating the animation curve, andAnimatorListener
for listening to the animation onEnd event.My current implementation has jittery animation due to the animation curve not being linear. I'm wondering if there is an easier way to do this without the missing animation parameters?