Compare commits

...

2 commits

Author SHA1 Message Date
Yohan Boniface
a7b714c887
fix: disable for real dragging the map on mobile when scrollWheelZoom is false (#2344)
Some checks failed
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled
Test & Docs / docs (push) Has been cancelled
Changing map options at this stage is too late.

cf #2340
2024-12-07 15:46:45 +01:00
Yohan Boniface
42f74e1554 fix: disable for real dragging the map on mobile when scrollWheelZoom is false
Changing map options at this stage is too late.

cf #2340
2024-12-06 11:27:30 +01:00

View file

@ -285,9 +285,14 @@ export const LeafletMap = BaseMap.extend({
setOptions(this, this._umap.properties) setOptions(this, this._umap.properties)
if (this.options.scrollWheelZoom) { if (this.options.scrollWheelZoom) {
this.scrollWheelZoom.enable() this.scrollWheelZoom.enable()
this.dragging.enable()
} else { } else {
this.scrollWheelZoom.disable() 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 // Needs tilelayer to exist for minimap
this.renderControls() this.renderControls()