fix: make that renderUI also recompute scrollWheelZoom
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run

Otherwise it does not change the behaviour when changing the setting.
This commit is contained in:
Yohan Boniface 2024-12-05 18:39:40 +01:00
parent b7649a5e47
commit 97ff26b6e8

View file

@ -96,12 +96,6 @@ const ControlsMixin = {
this._controls.more = new U.MoreControls() this._controls.more = new U.MoreControls()
this._controls.scale = L.control.scale() this._controls.scale = L.control.scale()
this._controls.permanentCredit = new U.PermanentCreditsControl(this) 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._umap.drop = new U.DropControl(this)
this._controls.tilelayers = new U.TileLayerControl(this) this._controls.tilelayers = new U.TileLayerControl(this)
}, },
@ -289,6 +283,12 @@ export const LeafletMap = BaseMap.extend({
renderUI: function () { renderUI: function () {
setOptions(this, this._umap.properties) 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 // Needs tilelayer to exist for minimap
this.renderControls() this.renderControls()
this.handleLimitBounds() this.handleLimitBounds()