Merge pull request #1332 from umap-project/editmode-for-old-maps

Do not try to set editMode on _umap_options for old maps
This commit is contained in:
David Larlet 2023-09-22 13:50:27 -04:00 committed by GitHub
commit 18b43458e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -357,7 +357,9 @@ L.U.DataLayer = L.Evented.extend({
// So do not let all options to be reset // So do not let all options to be reset
// Fix is a proper migration so all datalayers settings are // Fix is a proper migration so all datalayers settings are
// in DB, and we remove it from geojson flat files. // in DB, and we remove it from geojson flat files.
geojson['_umap_options']['editMode'] = this.options.editMode if (geojson._umap_options) geojson._umap_options.editMode = this.options.editMode
// In case of maps pre 1.0 still around
if (geojson._storage) geojson._storage.editMode = this.options.editMode
this.fromUmapGeoJSON(geojson) this.fromUmapGeoJSON(geojson)
this.backupOptions() this.backupOptions()
this.fire('loaded') this.fire('loaded')