wip: remove not effective code

Co-authored-by: David Larlet <david@larlet.fr>
This commit is contained in:
Yohan Boniface 2025-03-21 16:45:10 +01:00
parent 172de0e2d0
commit be52e7ca2f
2 changed files with 6 additions and 4 deletions

View file

@ -458,13 +458,13 @@ export class DataLayer extends ServerStored {
.sort(Utils.naturalSort)
}
addData(geojson, sync, batch = true) {
addData(geojson, sync) {
try {
// Do not fail if remote data is somehow invalid,
// otherwise the layer becomes uneditable.
if (batch) this.sync.startBatch()
this.sync.startBatch()
const features = this.makeFeatures(geojson, sync)
if (batch) this.sync.commitBatch()
this.sync.commitBatch()
return features
} catch (err) {
console.debug('Error with DataLayer', this.id)

View file

@ -64,7 +64,9 @@ export class DataLayerUpdater extends BaseUpdater {
} catch {
const datalayer = this._umap.createDataLayer(value._umap_options || value, false)
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)
}
}
}