fix: Avoid map-panning on mobile using two fingers navigation

If scrollWheelZoom option is false we deactivate leaflet dragging options only on mobile
This commit is contained in:
Florent Triquet 2024-12-05 13:55:49 +01:00
parent 8f7e5c7252
commit acbdfda581

View file

@ -96,8 +96,12 @@ const ControlsMixin = {
this._controls.more = new U.MoreControls()
this._controls.scale = L.control.scale()
this._controls.permanentCredit = new U.PermanentCreditsControl(this)
if (this.options.scrollWheelZoom) this.scrollWheelZoom.enable()
else this.scrollWheelZoom.disable()
if (this.options.scrollWheelZoom){
this.scrollWheelZoom.enable()
} else {
this.scrollWheelZoom.disable()
this.options.dragging = !L.Browser.mobile
}
this._umap.drop = new U.DropControl(this)
this._controls.tilelayers = new U.TileLayerControl(this)
},