Leaflet.SmoothWheelZoom icon indicating copy to clipboard operation
Leaflet.SmoothWheelZoom copied to clipboard

Doesn't zoom with mousewheel in Firefox

Open RoboVij opened this issue 1 year ago • 1 comments

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 avatar May 03 '23 09:05 RoboVij

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

RoboVij avatar May 03 '23 09:05 RoboVij