Prevent from using an id when restoring a umap backup

cf #1042
This commit is contained in:
Yohan Boniface 2023-06-26 08:02:15 +02:00
parent 001b79795a
commit 75326aa6ee

View file

@ -905,6 +905,7 @@ L.U.Map.include({
if (importedData.geometry) this.options.center = this.latLng(importedData.geometry) if (importedData.geometry) this.options.center = this.latLng(importedData.geometry)
const self = this const self = this
importedData.layers.forEach((geojson) => { importedData.layers.forEach((geojson) => {
delete geojson._umap_options['id'] // Never trust an id at this stage
const dataLayer = self.createDataLayer(geojson._umap_options) const dataLayer = self.createDataLayer(geojson._umap_options)
dataLayer.fromUmapGeoJSON(geojson) dataLayer.fromUmapGeoJSON(geojson)
}) })