Skip to content

Commit

Permalink
fix: make that renderUI also recompute scrollWheelZoom
Browse files Browse the repository at this point in the history
Otherwise it does not change the behaviour when changing the setting.
  • Loading branch information
yohanboniface committed Dec 5, 2024
1 parent b7649a5 commit 97ff26b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions umap/static/umap/js/modules/rendering/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 97ff26b

Please sign in to comment.