mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +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 (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()
|
||||
if (this.isRemoteLayer()) this.fetchRemoteData()
|
||||
else this.addData(geojson)
|
||||
|
|
|
@ -52,7 +52,9 @@ export class DataLayerUpdater extends BaseUpdater {
|
|||
|
||||
update({ key, metadata, value }) {
|
||||
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)
|
||||
} else {
|
||||
console.debug(
|
||||
|
|
Loading…
Reference in a new issue