streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.9k stars 356 forks source link

Zoom animation interrupts/bounces back #5860

Open pkoby opened 2 months ago

pkoby commented 2 months ago

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

Helium314 commented 2 months ago

Possibly it's because the zoom happens at the same time as your position is updated.

pkoby commented 2 months ago

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.

Helium314 commented 2 months ago

Does it also happen when the camera does not automatically follow your position?

pkoby commented 2 months ago

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.

westnordost commented 2 months ago

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

pkoby commented 2 months ago

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.

westnordost commented 2 months ago

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.