Zoom animation interrupts/bounces back
Sorry to keep adding bug reports. This is the last one for today, I promise! Thank you so much for all your work!
Sometimes when tapping the zoom buttons, the map doesn't zoom the whole amount its supposed to, and even bounces back a bit.
https://github.com/user-attachments/assets/4d6529fa-9de5-44bb-aafc-ee21fe746fd1
How to Reproduce
Tap the zoom buttons. Sometimes it seems to get interrupted, but it's not clear what is causing this. Might be because I have a slow older phone.
Expected Behavior
Smooth zoom with a consistent amount, no bouncing.
Versions affected
v59.0-alpha2
Possibly it's because the zoom happens at the same time as your position is updated.
I tried to determine that, but I wasn't able to verify a correlation with the naked eye. This clip shows two bounces back to back, but it's often fine even while it seems position is moving.
Does it also happen when the camera does not automatically follow your position?
No, it doesn't seem to. So it does seem to be related to position. It doesn't happen very consistently, so it's hard to tell if it's related to distance traveled or something.
Hmm, I think this is simply a limitation on the current MapLibre camera API. It is not made for allowing parallel camera animations (e.g. zooming in, then while zooming in move camera to different position but continue zooming in). Each call to animate camera to a new state overwrites the last. For tangram-es I remember I wrote a complicated wrapper with logic to workaround this limitation. I don't really want to do this for MapLibre as
- MapLibre is maintained, so there is a chance that they implement something like that (though unlikely)
- the tangram-es implementation was causing other problems left and right. I think one problem that caused odd behavior remained unsolved forever (pressing zoom-in button while zooming in to quest would make ALL following animations finish immediately)
- believe it or not, the current MapLibre API is but a stepping stone towards another big rewrite on the MapLibre stuff, using yet another (TBD - compose based) API. So, this is why I don't want to put a lot of effort into finding solutions for small convenience issues in this API
Understandable. I know there will be growing pains with this huge switch to MapLibre, and I'm just happy to have such a good app continue to grow. I also wasn't sure how many of these bugs I submitted today were map-related vs SC-related.
Reported upstream (as a bug, but maybe it is rather a feature request), but not closing yet because maybe we can find a reasonably cheap to implement workaround.