mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix: disable for real dragging the map on mobile when scrollWheelZoom is false (#2344)
Changing map options at this stage is too late. cf #2340
This commit is contained in:
commit
a7b714c887
1 changed files with 6 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue