Skip to content

Commit

Permalink
fix: Allow to import GeoJson with panes (closes #852)
Browse files Browse the repository at this point in the history
  • Loading branch information
claustres committed May 12, 2024
1 parent ac91688 commit c508a4a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions map/client/mixins/map/mixin.base-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c508a4a

Please sign in to comment.