mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
fix(sync): fix tilelayer change not synced (#2569)
This commit is contained in:
commit
c417e94698
4 changed files with 14 additions and 1 deletions
|
@ -269,8 +269,12 @@ export const LeafletMap = BaseMap.extend({
|
||||||
this.renderUI()
|
this.renderUI()
|
||||||
},
|
},
|
||||||
|
|
||||||
renderUI: function () {
|
pullProperties() {
|
||||||
setOptions(this, this._umap.properties)
|
setOptions(this, this._umap.properties)
|
||||||
|
},
|
||||||
|
|
||||||
|
renderUI: function () {
|
||||||
|
this.pullProperties()
|
||||||
if (this.options.scrollWheelZoom) {
|
if (this.options.scrollWheelZoom) {
|
||||||
this.scrollWheelZoom.enable()
|
this.scrollWheelZoom.enable()
|
||||||
this.dragging.enable()
|
this.dragging.enable()
|
||||||
|
|
|
@ -47,6 +47,7 @@ export class MapUpdater extends BaseUpdater {
|
||||||
this.updateObjectValue(this._umap, key, value)
|
this.updateObjectValue(this._umap, key, value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._umap.onPropertiesUpdated([key])
|
||||||
this._umap.render([key])
|
this._umap.render([key])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1329,6 +1329,10 @@ export default class Umap extends ServerStored {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onPropertiesUpdated(fields = []) {
|
||||||
|
this._leafletMap.pullProperties()
|
||||||
|
}
|
||||||
|
|
||||||
render(fields = []) {
|
render(fields = []) {
|
||||||
// Propagate will remove the fields it has already
|
// Propagate will remove the fields it has already
|
||||||
// processed
|
// processed
|
||||||
|
|
|
@ -302,6 +302,10 @@ U.TileLayerChooser = L.Control.extend({
|
||||||
if (options?.edit) {
|
if (options?.edit) {
|
||||||
this.map._umap.properties.tilelayer = tilelayer.toJSON()
|
this.map._umap.properties.tilelayer = tilelayer.toJSON()
|
||||||
this.map._umap.isDirty = true
|
this.map._umap.isDirty = true
|
||||||
|
this.map._umap.sync.update(
|
||||||
|
'properties.tilelayer',
|
||||||
|
this.map._umap.properties.tilelayer
|
||||||
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
this
|
this
|
||||||
|
|
Loading…
Reference in a new issue