From 97ff26b6e86bd204c6b383c4c796f99363ac9f1f Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 5 Dec 2024 18:39:40 +0100 Subject: [PATCH] fix: make that renderUI also recompute scrollWheelZoom Otherwise it does not change the behaviour when changing the setting. --- umap/static/umap/js/modules/rendering/map.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/umap/static/umap/js/modules/rendering/map.js b/umap/static/umap/js/modules/rendering/map.js index 6ada48d6..4abe5351 100644 --- a/umap/static/umap/js/modules/rendering/map.js +++ b/umap/static/umap/js/modules/rendering/map.js @@ -96,12 +96,6 @@ 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() - this.options.dragging = !L.Browser.mobile - } this._umap.drop = new U.DropControl(this) this._controls.tilelayers = new U.TileLayerControl(this) }, @@ -289,6 +283,12 @@ export const LeafletMap = BaseMap.extend({ renderUI: function () { setOptions(this, this._umap.properties) + if (this.options.scrollWheelZoom) { + this.scrollWheelZoom.enable() + } else { + this.scrollWheelZoom.disable() + this.options.dragging = !L.Browser.mobile + } // Needs tilelayer to exist for minimap this.renderControls() this.handleLimitBounds()