Allow for a layer to not have a marker when loading from studio

This commit is contained in:
Pieter Vander Vennet 2023-12-05 00:04:11 +01:00
parent 4e1384c2df
commit e6f0b8024d

View file

@ -139,9 +139,9 @@ export default class DetermineLayout {
const layerConfig = <LayerConfigJson>json const layerConfig = <LayerConfigJson>json
const iconTr: string | TagRenderingConfigJson = <any>( const iconTr: string | TagRenderingConfigJson = <any>(
layerConfig.pointRendering layerConfig.pointRendering
.map((mr) => mr.marker.find((icon) => icon.icon !== undefined).icon) .map((mr) => mr?.marker?.find((icon) => icon.icon !== undefined)?.icon)
.find((i) => i !== undefined) .find((i) => i !== undefined)
) ) ?? "bug"
const icon = new TagRenderingConfig(iconTr).render.txt const icon = new TagRenderingConfig(iconTr).render.txt
json = { json = {
id: json.id, id: json.id,