Skip to content

Mouse wheel stops animation when scrollZoom is disabled #9230

Closed

Description

@TiloNN

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/

Activity

  1. 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? [/+] on Jan 24, 2020
  2. kkaefer commented on Jan 24, 2020

    @kkaefer
    Member

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

  3. changed the title [-]Mouse wheel stops a animation, even when scrollZoom was disabled. Is this wanted? [/-] [+]Mouse wheel stops animation when scrollZoom is disabled[/+] on Jan 24, 2020
  4. ansis commented on Apr 7, 2020

    @ansis
    Contributor

    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.

  5. karimnaaji commented on Apr 14, 2020

    @karimnaaji
    Contributor
  6. TiloNN commented on Apr 27, 2020

    @TiloNN
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions