mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +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)
|
||||
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)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue