From 5f5805dc09019f7e37e58aa2fa1c745795a5b372 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 30 May 2024 14:12:18 +0200 Subject: [PATCH] fix: support old storage options when importing a umap file --- umap/static/umap/js/umap.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 054ff897..c9ea9d0c 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -877,7 +877,11 @@ U.Map = L.Map.extend({ if (importedData.geometry) this.options.center = this.latLng(importedData.geometry) const self = this importedData.layers.forEach((geojson) => { - delete geojson._umap_options['id'] // Never trust an id at this stage + if (!geojson._umap_options && geojson._storage) { + geojson._umap_options = geojson._storage + delete geojson._storage + } + delete geojson._umap_options?.id // Never trust an id at this stage const dataLayer = self.createDataLayer(geojson._umap_options) dataLayer.fromUmapGeoJSON(geojson) })