Skip to content

Commit

Permalink
fix: Avoid map-panning on mobile using two fingers navigation
Browse files Browse the repository at this point in the history
If scrollWheelZoom option is false we deactivate leaflet dragging options only on mobile
  • Loading branch information
Florent Triquet committed Dec 5, 2024
1 parent 8f7e5c7 commit acbdfda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions umap/static/umap/js/modules/rendering/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down

0 comments on commit acbdfda

Please sign in to comment.