From c508a4a9ca5dbd22e39c0866e4c9548c166d4b64 Mon Sep 17 00:00:00 2001 From: Luc Claustres Date: Sun, 12 May 2024 20:50:14 +0200 Subject: [PATCH] fix: Allow to import GeoJson with panes (closes #852) --- map/client/mixins/map/mixin.base-map.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/map/client/mixins/map/mixin.base-map.js b/map/client/mixins/map/mixin.base-map.js index 6a10f436c..c0016d913 100644 --- a/map/client/mixins/map/mixin.base-map.js +++ b/map/client/mixins/map/mixin.base-map.js @@ -438,6 +438,15 @@ export const baseMap = { if (geoJson.type === 'FeatureCollection') _.forEach(geoJson.features, feature => { feature._id = uid().toString() }) else geoJson._id = uid().toString() } + // Check for panes to be created + const panes = [] + _.forEach(geoJson.features, feature => { + const pane = _.get(feature, 'style.pane') + if (pane) panes.push({ + name: pane + }) + }) + if (!_.isEmpty(panes)) _.set(layerSpec, 'leaflet.panes', panes) // Create an empty layer used as a container await this.addLayer(layerSpec) // Set the content