mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fixup: fix tilelayer switch not saved anymore
Since map split.
This commit is contained in:
parent
fe06a0ff8e
commit
ce765efefc
2 changed files with 6 additions and 7 deletions
|
@ -233,12 +233,8 @@ const ManageTilelayerMixin = {
|
|||
},
|
||||
|
||||
updateTileLayers: function () {
|
||||
const callback = (tilelayer) => {
|
||||
this.options.tilelayer = tilelayer.toJSON()
|
||||
this._umap.isDirty = true
|
||||
}
|
||||
if (this._controls.tilelayersChooser) {
|
||||
this._controls.tilelayersChooser.openSwitcher({ callback, edit: true })
|
||||
this._controls.tilelayersChooser.openSwitcher({ edit: true })
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
@ -683,10 +683,13 @@ U.TileLayerChooser = L.Control.extend({
|
|||
L.DomEvent.on(
|
||||
el,
|
||||
'click',
|
||||
function () {
|
||||
() => {
|
||||
this.map.selectTileLayer(tilelayer)
|
||||
this.map._controls.tilelayers.setLayers()
|
||||
if (options?.callback) options.callback(tilelayer)
|
||||
if (options?.edit) {
|
||||
this.map._umap.properties.tilelayer = tilelayer.toJSON()
|
||||
this.map._umap.isDirty = true
|
||||
}
|
||||
},
|
||||
this
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue