Mapbox-gl-js: Mousewheel zoom very slow - Chrome/Linux

Created on 8 Nov 2018  路  9Comments  路  Source: mapbox/mapbox-gl-js

mapbox-gl-js version: v0.51.0

browser: Chrome 70.0.3538.77 (64-Bit) on Linux

Steps to Trigger Behavior

Use the mousewheel for zooming in and out.

Link to Demonstration

https://www.mapbox.com/mapbox-gl-js/example/simple-map/ with hash: true

Expected Behavior

Zooming in and out happens faster, at least 0.25 zoom level per mousewheel "click".

Actual Behavior

Only 0.08 - 0.09 zoom level per mousewheel "click".


Tried it on 2 different machines.

For comparision:

| | zoom level / mousewheel "click" |
| ------------- | ------------- |
| Google Maps | 0.25 |
| www.openstreetmap.org | 1 |

bug environment-specific

Most helpful comment

Logitech MX ERGO and Logitech G402, Debian, no additional driver and both with the same behavior.

wheelZoomDelta should be OS specific

It is also dependent on the browser, here the values for Firefox 60.3.0esr:

| Firefox/Linux | zoom level / mousewheel tick |
| ------------- | ------------- |
| Mapbox GL JS | 0.18 (0.08-0.09 with Chrome) |
| Google Maps | 0.25 |
| www.openstreetmap.org | 1 |

On Windows 7 I get also 0.18 for Chrome/FF with Mapbox GL JS.

if you change the values to make it perfect for me, it will be way to fast for the next person

For a consistent behavior across different OS/device/browser combinations it looks like you have to do some kind of delta normalization, something like:

All 9 comments

I notice this too.

Using my laptop trackpad two finger scroll I can go from z0 to z24 in about full 4 scroll motions, compared to on the mousewheel it takes 24 motions.

It's so painful with the mouse scroll, by habit I either use the trackpad or use the shift zoom box feature, which takes 3 motions to get from z0 to z24.

@andrewharvey What OS are you using?
@pathmapper & @andrewharvey What type of mouse devices are you using and do you have any additional device driver software installed to configure scroll wheels?

Our implementation uses these magic numbers to implement wheel zoom:

https://github.com/mapbox/mapbox-gl-js/blob/c708474eb65d9c6a117fe232b677db19525f70b4/src/ui/handler/scroll_zoom.js#L17-L22

This archived link seems to show that the wheelZoomDelta should be OS specific, but I'm not sure if that is true any longer.

Debian, just a very stock standard mouse.

I never reported the issue since it's very depended on OS and the mouse hardware, if you change the values to make it perfect for me, it will be way to fast for the next person. Plus at the moment you can make small adjustments in zoom if you make it faster you'll loose that precision.

It partly might just be down to my OS settings, I could probably make the scroll faster on my end already.

Even regular web pages I find scroll to slow, so certainly don't count my voice for much. It is still slightly slower scrolling that Google Maps though.

Logitech MX ERGO and Logitech G402, Debian, no additional driver and both with the same behavior.

wheelZoomDelta should be OS specific

It is also dependent on the browser, here the values for Firefox 60.3.0esr:

| Firefox/Linux | zoom level / mousewheel tick |
| ------------- | ------------- |
| Mapbox GL JS | 0.18 (0.08-0.09 with Chrome) |
| Google Maps | 0.25 |
| www.openstreetmap.org | 1 |

On Windows 7 I get also 0.18 for Chrome/FF with Mapbox GL JS.

if you change the values to make it perfect for me, it will be way to fast for the next person

For a consistent behavior across different OS/device/browser combinations it looks like you have to do some kind of delta normalization, something like:

I have the same problem on both my Linux machines (Fedora 29 and latest Manjaro). Zooming in and out is very slow in both Chrome 75 and GNOME Web which is based on WebKit (like Safari). However, it works well in Firefox 67.

I am a little bit resistant to implementing a workaround using the new setWheelZoomRate method because sometimes it seems to jump really quickly and the workaround might make it even worse.

Can this issue be solved on the Mapbox GL JS side? I think you can easily reproduce it on any Linux machine with Chrome browser.

After thinking I had encountered this, and then eventually realising it was self inflicted, I now notice that the zoom actually works fine, and there don't seem to be any issues on Linux (Ubuntu 20.10). I don't appear to be able to reproduce the issue. Is it still an issue for others? Can this bug be closed?

@antony When I open this example, I can see that the behavior hasn't really changed. It is still much slower in Chrome than in Firefox on my Manjaro Linux.

I have same issue that just popped up in past few days. It's only happening in Chrome and Edge on Windows 10. Firefox working fine.

I didn't change anything, and suddenly scrolling around is painfully slow. Clearly the browser was changed and not GL JS, but would be nice to know what the issue is. s

I'm with @livthomas, for me the scrolling behaviour hasn't changed recently (Chrome on Linux), it's always been happening for a long time. On Firefox it feels perfect, but Chrome I've trained myself to use trackpad scroll or boxzoom scroll instead of the mousewheel since Chrome scroll is about 2.2x as many wheel scrolls to compared to Firefox.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mollymerp picture mollymerp  路  3Comments

foundryspatial-duncan picture foundryspatial-duncan  路  3Comments

aendrew picture aendrew  路  3Comments

Scarysize picture Scarysize  路  3Comments

aderaaij picture aderaaij  路  3Comments