mutsuyuki / Leaflet.SmoothWheelZoom

Smooth wheel zoom plugin for leaflet. This plugin provide smooth zoom ux like Google map.
MIT License
79 stars 31 forks source link

Doesn't zoom with mousewheel in Firefox #10

Open RoboVij opened 1 year ago

RoboVij commented 1 year ago

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 commented 1 year ago

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