mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 20:02:36 +02:00
Merge pull request #1868 from umap-project/fix-layer-old-storage
fix: support old storage options when importing a umap file
This commit is contained in:
commit
88103f284a
1 changed files with 5 additions and 1 deletions
|
@ -877,7 +877,11 @@ U.Map = L.Map.extend({
|
||||||
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
|
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)
|
const dataLayer = self.createDataLayer(geojson._umap_options)
|
||||||
dataLayer.fromUmapGeoJSON(geojson)
|
dataLayer.fromUmapGeoJSON(geojson)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue