Switch from mousewheel to wheel, as Leaflet did

Otherwise, wheel will zoom the map even when sent on a panel or
control.
This commit is contained in:
Yohan Boniface 2023-07-17 12:33:35 +02:00
parent 891c23747f
commit bbcf9d8b96
2 changed files with 2 additions and 2 deletions

View file

@ -472,7 +472,7 @@ L.U.DataLayersControl = L.Control.extend({
if (L.Browser.pointer) { if (L.Browser.pointer) {
L.DomEvent.disableClickPropagation(container) L.DomEvent.disableClickPropagation(container)
L.DomEvent.on(container, 'mousewheel', L.DomEvent.stopPropagation) L.DomEvent.on(container, 'wheel', L.DomEvent.stopPropagation)
L.DomEvent.on(container, 'MozMousePixelScroll', L.DomEvent.stopPropagation) L.DomEvent.on(container, 'MozMousePixelScroll', L.DomEvent.stopPropagation)
} }
if (!L.Browser.touch) { if (!L.Browser.touch) {

View file

@ -11,7 +11,7 @@ L.U.UI = L.Evented.extend({
this.container = L.DomUtil.create('div', 'leaflet-ui-container', this.parent) this.container = L.DomUtil.create('div', 'leaflet-ui-container', this.parent)
L.DomEvent.disableClickPropagation(this.container) L.DomEvent.disableClickPropagation(this.container)
L.DomEvent.on(this.container, 'contextmenu', L.DomEvent.stopPropagation) // Do not activate our custom context menu. L.DomEvent.on(this.container, 'contextmenu', L.DomEvent.stopPropagation) // Do not activate our custom context menu.
L.DomEvent.on(this.container, 'mousewheel', L.DomEvent.stopPropagation) L.DomEvent.on(this.container, 'wheel', L.DomEvent.stopPropagation)
L.DomEvent.on(this.container, 'MozMousePixelScroll', L.DomEvent.stopPropagation) L.DomEvent.on(this.container, 'MozMousePixelScroll', L.DomEvent.stopPropagation)
this._panel = L.DomUtil.create('div', '', this.container) this._panel = L.DomUtil.create('div', '', this.container)
this._panel.id = 'umap-ui-container' this._panel.id = 'umap-ui-container'