GIScience / ors-map-client

Openrouteservice API web SPA client using VueJS, Vuetify and Vue2Leaflet
http://maps.openrouteservice.org
Apache License 2.0
106 stars 32 forks source link

Scroll wheel zoom inconsistent #348

Open nipsufn opened 1 year ago

nipsufn commented 1 year ago

Using mouse scroll wheel yields inconsistent results, usually zooming in/out by 2 levels, but sometimes by 1. Appears to affect both Chromium and Firefox desktop browsers.

TheGreatRefrigerator commented 11 months ago

Hi @nipsufn, i couldn't reproduce this. This could just as well be an issue with the mouse you are using, or its settings.

Could you maybe verify this doesn't happen in other programs as well? (e.g. normal website scrolling, word documents etc.)

nipsufn commented 11 months ago

It does not happen in other map apps (Google Maps, Mapy CZ).

I did some more digging, it appears that zoom levels are skipped when wheelDelta on wheel event is bigger than few tens. Looks like Leaflet's code is responsible https://github.com/Leaflet/Leaflet/blob/3db042fcef041c269d489c3bf3e766df4a8771c5/src/map/handler/Map.ScrollWheelZoom.js#L61, and that upstream is aware of the issue but not very active: https://github.com/Leaflet/Leaflet/issues/8652, https://github.com/Leaflet/Leaflet/issues/4696. Latter issue contains some code that could be used to override default behavior and a Leaflet plugin adjusting how zoom works. With Leaflet being wrapped in Vue, I'm afraid this is a bit over my head to open a PR myself.