mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
fix: allow to save a remote data with unloaded data (#2657)
When loading remote data fails, the layer is in state "unloaded", and thus it was not possible to save it. This "isLoaded" check is made for non remote layer so that we don't save it by mistake with no data. Also, let's allow to edit non loaded layers, this check was there when settings was not on db, so not all loaded at map init, again not to override with incomplete metadata.
This commit is contained in:
commit
92ca581fb6
1 changed files with 2 additions and 2 deletions
|
@ -656,7 +656,7 @@ export class DataLayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
edit() {
|
edit() {
|
||||||
if (!this._umap.editEnabled || !this.isLoaded()) {
|
if (!this._umap.editEnabled) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const container = DomUtil.create('div', 'umap-layer-properties-container')
|
const container = DomUtil.create('div', 'umap-layer-properties-container')
|
||||||
|
@ -1116,7 +1116,7 @@ export class DataLayer {
|
||||||
|
|
||||||
async save() {
|
async save() {
|
||||||
if (this.isDeleted) return await this.saveDelete()
|
if (this.isDeleted) return await this.saveDelete()
|
||||||
if (!this.isLoaded()) return
|
if (!this.isRemoteLayer() && !this.isLoaded()) return
|
||||||
const geojson = this.umapGeoJSON()
|
const geojson = this.umapGeoJSON()
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('name', this.options.name)
|
formData.append('name', this.options.name)
|
||||||
|
|
Loading…
Reference in a new issue