1 (edited by mikejm 2021-12-01 07:59:30)

Topic: How to snap zoom to "sharp" integers when zoomed with finger gestures?

I am using Online Maps in a mobile app. I have just tested the implementation on my Android phone. The map shows well, and if I zoom in by double tapping the map, it zooms incrementally forward in discrete steps that maintain the focus of the map.

However, if I zoom in with my fingers (two fingers spreading apart on the screen) it no longer snaps to any given zoom level but rather will show any intermediate level of zoom I set with my fingers.

The problem with this is the intermediate levels of zoom are blurry so I end up with a lot of blur at most levels of zooming this way.

Is there any way to ensure the zooming done by fingers in this way snaps to the increments of zoom that will remain sharp?

I presume I need to assess the zoom increment of the view and then round it up or down to an even integer after each resize gesture but I don't know how to do this programmatically or if there is an option that handles this automatically already.

Thanks.

Re: How to snap zoom to "sharp" integers when zoomed with finger gestures?

Hello.

This behavior is implemented by the third party script SmoothZoomOnMouseEvents.
If you want to add this behavior when the zoom gesture ends, make a new script based on this script, but listen to OnSmoothZoomFinish instead of OnValidateZoom.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.