From e7d47b4ce5f19fd3a5fac6788758009b021ed644 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Wed, 21 Jun 2023 13:46:35 +0200 Subject: [PATCH] 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 --- umap/static/umap/js/umap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index d146c1dd..ece04f7c 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -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) })