mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
wip: remove not effective code
Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
parent
172de0e2d0
commit
be52e7ca2f
2 changed files with 6 additions and 4 deletions
|
@ -458,13 +458,13 @@ export class DataLayer extends ServerStored {
|
||||||
.sort(Utils.naturalSort)
|
.sort(Utils.naturalSort)
|
||||||
}
|
}
|
||||||
|
|
||||||
addData(geojson, sync, batch = true) {
|
addData(geojson, sync) {
|
||||||
try {
|
try {
|
||||||
// Do not fail if remote data is somehow invalid,
|
// Do not fail if remote data is somehow invalid,
|
||||||
// otherwise the layer becomes uneditable.
|
// otherwise the layer becomes uneditable.
|
||||||
if (batch) this.sync.startBatch()
|
this.sync.startBatch()
|
||||||
const features = this.makeFeatures(geojson, sync)
|
const features = this.makeFeatures(geojson, sync)
|
||||||
if (batch) this.sync.commitBatch()
|
this.sync.commitBatch()
|
||||||
return features
|
return features
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.debug('Error with DataLayer', this.id)
|
console.debug('Error with DataLayer', this.id)
|
||||||
|
|
|
@ -64,7 +64,9 @@ export class DataLayerUpdater extends BaseUpdater {
|
||||||
} catch {
|
} catch {
|
||||||
const datalayer = this._umap.createDataLayer(value._umap_options || value, false)
|
const datalayer = this._umap.createDataLayer(value._umap_options || value, false)
|
||||||
if (value.features) {
|
if (value.features) {
|
||||||
datalayer.addData(value, true, false)
|
// FIXME: this will create new stages in the undoStack, thus this will empty
|
||||||
|
// the redoStack
|
||||||
|
datalayer.addData(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue