From d67a17eca3673d3dfe0b371a0f2369177c2e5366 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Fri, 22 Sep 2023 19:03:01 +0200 Subject: [PATCH] Do not try to set editMode on _umap_options for old maps --- umap/static/umap/js/umap.layer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index bc4b5684..81a4cd21 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -357,7 +357,9 @@ L.U.DataLayer = L.Evented.extend({ // So do not let all options to be reset // Fix is a proper migration so all datalayers settings are // 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.backupOptions() this.fire('loaded')