Pass options at datalayer creation when importing from umap file

fix #1042

Until now, we create an empty datalayer (which has some defaults),
then we overwrite the options while calling fromGeoJSON method
This commit is contained in:
Yohan Boniface 2023-06-21 13:46:35 +02:00
parent bbf4b72e07
commit e7d47b4ce5

View file

@ -1038,7 +1038,7 @@ L.U.Map.include({
if (importedData.geometry) this.options.center = this.latLng(importedData.geometry)
const self = this
importedData.layers.forEach((geojson) => {
const dataLayer = self.createDataLayer()
const dataLayer = self.createDataLayer(geojson._umap_options)
dataLayer.fromUmapGeoJSON(geojson)
})