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

Doesn't zoom with mousewheel in Firefox #10

Open
RoboVij opened this issue May 3, 2023 · 1 comment
Open

Doesn't zoom with mousewheel in Firefox #10

RoboVij opened this issue May 3, 2023 · 1 comment

Comments

@RoboVij
Copy link

RoboVij commented May 3, 2023

Zooming in/out with mousewheel doesnt seem to work in Firefox. No problem in Chrome, Edge. Your Demo works fine and my project without this plugin works fine.

I placed your SmoothWheelZoom.js file in my src directory and imported in my file.

   import "../Leaflet.SmoothWheelZoom.js";

    this.map = L.map("map", {
      preferCanvas: true,
      tap: false,
      zoomControl: false,
      scrollWheelZoom: false, // disable original zoom function
      // @ts-expect-error: Till a way is found to extend Map definition
      smoothWheelZoom: true,  // enable smooth zoom
      smoothSensitivity: 0.25,   // zoom speed. default is 1
      editable: true
    });
    L.control.zoom({ position: "topright" }).addTo(this.map);
    this.tileLayer = L.tileLayer(this.url, {
      attribution: this.attribution,
      maxZoom: 30
    });
    // this.map.scrollWheelZoom = true;   // This doesn't work too

@mutsuyuki Any suggestions?

@RoboVij
Copy link
Author

RoboVij commented May 3, 2023

Ah! Just realised that I'm using the code from one of your forks which wasn't updated. But even after using your updated code, there's still some issue. The zooming experience in Firefox isn't as smooth as Chrome. At smoothSensitivity: 0.25 it struggles to barely even move. smoothSensitivity: 3 is usable but not giving a smooth experience

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

1 participant