Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scroll wheel zoom inconsistent #348

Open
nipsufn opened this issue Apr 2, 2023 · 2 comments
Open

Scroll wheel zoom inconsistent #348

nipsufn opened this issue Apr 2, 2023 · 2 comments

Comments

@nipsufn
Copy link

nipsufn commented Apr 2, 2023

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
Copy link
Collaborator

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
Copy link
Author

nipsufn commented Oct 20, 2023

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: Leaflet/Leaflet#8652, Leaflet/Leaflet#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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants