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

Mouse wheel stops animation when scrollZoom is disabled #9230

Closed
TiloNN opened this issue Jan 24, 2020 · 4 comments
Closed

Mouse wheel stops animation when scrollZoom is disabled #9230

TiloNN opened this issue Jan 24, 2020 · 4 comments
Labels

Comments

@TiloNN
Copy link

TiloNN commented Jan 24, 2020

mapbox-gl-js version: 1.6.1

Question

Is it correct, that a user mouse wheel interaction stops a fly to animation, even when the scrollZoom was deactivated?

map.on('wheel', function(e) {
    e.preventDefault();
});

map['scrollZoom'].disable();
map['boxZoom'].disable();
map['dragRotate'].disable();
map['dragPan'].disable();
map['keyboard'].disable();
map['doubleClickZoom'].disable();
map['touchZoomRotate'].disable();

map.fitBounds( geojsonExtent(geojson), {
    padding: {top: 200, bottom:30, left: 30, right: 30}
});

If so, Is there a way to prevent that?
I opened a stackoverflow question, but like to make sure it is not a bug.

https://stackoverflow.com/questions/59895815/how-to-prevent-with-mapbox-gl-js-that-a-mouse-wheel-interaction-stops-a-fitboun

Thx for your support!

Links to related documentation

https://docs.mapbox.com/mapbox-gl-js/example/disable-scroll-zoom/

@TiloNN TiloNN changed the title Deactivated mouse wheel interaction stops a fitBounds animation. Is this wanted? Mouse wheel stops a animation, even when scrollZoom was disabled. Is this wanted? Jan 24, 2020
@kkaefer
Copy link
Contributor

kkaefer commented Jan 24, 2020

Thanks for this bug report. This indeed is a bug; mouse wheel activity shouldn't interfere with anything if the scrollZoom handler is disabled.

@kkaefer kkaefer changed the title Mouse wheel stops a animation, even when scrollZoom was disabled. Is this wanted? Mouse wheel stops animation when scrollZoom is disabled Jan 24, 2020
@ansis ansis mentioned this issue Apr 7, 2020
17 tasks
@ansis
Copy link
Contributor

ansis commented Apr 7, 2020

This has been fixed by #9365. If you have a chance to test and confirm, that would be great! The fix is in master and will be released in a beta release tomorrow.

@ansis ansis closed this as completed Apr 7, 2020
@karimnaaji
Copy link
Contributor

@TiloNN the fix that @ansis mentioned was published yesterday, feel free to give it a try! https://www.npmjs.com/package/mapbox-gl/v/1.10.0-beta.1

@TiloNN
Copy link
Author

TiloNN commented Apr 27, 2020

Looks good.
Works for me, thanks!
I'll wait until it leaves beta before using it productive.

Can't reproduce this issue on version 1.9.1 either anymore.
Makes this sense for you?

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

No branches or pull requests

4 participants