tangrams / tangram-es

2D and 3D map renderer using OpenGL ES
MIT License
822 stars 238 forks source link

Zooming out with tap+drag gesture is too fast #2207

Closed kuba-orlik closed 3 years ago

kuba-orlik commented 3 years ago

TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:

RESULT:

The map zooms out super fast, goes from street level to world level in a fraction of a second.

See the result here:

https://vimeo.com/480702185

EXPECTED RESULT:

The zoom out happens more gradually, allowing for fine control of the zoom level

ENVIRONMENT:

OTHER:

The bug happens on StreetComplete, but to my understanding the authors of the app did not change the behavior of the tap+drag gesture in any way

westnordost commented 3 years ago

tangram 0.13.0

matteblair commented 3 years ago

Thanks for the report and the video - that does seem way too fast. I'll check this out.

westnordost commented 3 years ago

I am not sure if this behavior is overrideable at all? Can you tell which touch input responder this would be?

matteblair commented 3 years ago

The pinch scaling and the tap-swipe scaling behaviors are handled by a ScaleResponder (https://github.com/tangrams/tangram-es/blob/master/platforms/android/tangram/src/main/java/com/mapzen/tangram/TouchInput.java#L151-L173). Both of these gestures are detected by Android's built-in ScaleGestureDetector.

matteblair commented 3 years ago

I was able to reproduce an issue with the quick-scale gesture that seems similar to this. The changes in https://github.com/tangrams/tangram-es/pull/2208 resolved the problem that I was seeing.

In your app, can you try setting the MapController to continuous rendering mode with mapController.setRenderMode(1)? If that change fixes this behavior on your end then it's very likely that you are having the same problem that I saw.

westnordost commented 3 years ago

Wait, in which timezone are you? I thought you were in the US?

Anyway, I tried it out with setting mapController.setRenderMode(1) and I can confirm that it workarounds the behavior.

matteblair commented 3 years ago

Cool! Changing the render mode might be ok as a temporary workaround, but be aware that it will increase power consumption.

I am in the US but have very late hours 🙃

westnordost commented 3 years ago

Okay, me too ;-)

I rather choose not to do the temporary workaround if it is going to shorten the battery life but wait for the next release

matteblair commented 3 years ago

I believe this is resolved by https://github.com/tangrams/tangram-es/pull/2208, which has been released in version 0.14.0. Please re-open if you encounter this again after upgrading!