Skip to content

Commit

Permalink
fix: disable for real dragging the map on mobile when scrollWheelZoom…
Browse files Browse the repository at this point in the history
… is false

Changing map options at this stage is too late.

cf #2340
  • Loading branch information
yohanboniface committed Dec 6, 2024
1 parent 97ff26b commit 42f74e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion umap/static/umap/js/modules/rendering/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,14 @@ export const LeafletMap = BaseMap.extend({
setOptions(this, this._umap.properties)
if (this.options.scrollWheelZoom) {
this.scrollWheelZoom.enable()
this.dragging.enable()
} else {
this.scrollWheelZoom.disable()
this.options.dragging = !L.Browser.mobile
// In mobile, do not let the user move the map
// when scrolling the main page and touching the
// map in an iframe. May be a bit dumb, but let's
// try like this for now.
if (L.Browser.mobile) this.dragging.disable()
}
// Needs tilelayer to exist for minimap
this.renderControls()
Expand Down

0 comments on commit 42f74e1

Please sign in to comment.