mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
wip: allow to sync version restore
Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
parent
c933df585c
commit
e41ad4e069
2 changed files with 8 additions and 2 deletions
|
@ -918,7 +918,11 @@ export class DataLayer {
|
||||||
)
|
)
|
||||||
if (!error) {
|
if (!error) {
|
||||||
if (geojson._storage) geojson._umap_options = geojson._storage // Retrocompat.
|
if (geojson._storage) geojson._umap_options = geojson._storage // Retrocompat.
|
||||||
if (geojson._umap_options) this.setOptions(geojson._umap_options)
|
if (geojson._umap_options) {
|
||||||
|
const oldOptions = Utils.CopyJSON(this.options)
|
||||||
|
this.setOptions(geojson._umap_options)
|
||||||
|
this.sync.update('options', this.options, oldOptions)
|
||||||
|
}
|
||||||
this.empty()
|
this.empty()
|
||||||
if (this.isRemoteLayer()) this.fetchRemoteData()
|
if (this.isRemoteLayer()) this.fetchRemoteData()
|
||||||
else this.addData(geojson)
|
else this.addData(geojson)
|
||||||
|
|
|
@ -52,7 +52,9 @@ export class DataLayerUpdater extends BaseUpdater {
|
||||||
|
|
||||||
update({ key, metadata, value }) {
|
update({ key, metadata, value }) {
|
||||||
const datalayer = this.getDataLayerFromID(metadata.id)
|
const datalayer = this.getDataLayerFromID(metadata.id)
|
||||||
if (Utils.fieldInSchema(key)) {
|
if (key === 'options') {
|
||||||
|
datalayer.setOptions(value)
|
||||||
|
} else if (Utils.fieldInSchema(key)) {
|
||||||
Utils.setObjectValue(datalayer, key, value)
|
Utils.setObjectValue(datalayer, key, value)
|
||||||
} else {
|
} else {
|
||||||
console.debug(
|
console.debug(
|
||||||
|
|
Loading…
Reference in a new issue