Fix bug: allow custom themes without icon

This commit is contained in:
Pieter Vander Vennet 2024-06-20 14:04:01 +02:00
parent cd0d275965
commit b96fb595de

View file

@ -170,10 +170,13 @@ export default class DetermineLayout {
if (json.layers === undefined && json.tagRenderings !== undefined) {
// We got fed a layer instead of a theme
const layerConfig = <LayerConfigJson>json
const icon = Utils.NoNull(
let icon = Utils.NoNull(
layerConfig.pointRendering
.flatMap((pr) => pr.marker)
.map((iconSpec) => {
if(!iconSpec){
return undefined
}
const icon = new TagRenderingConfig(<TagRenderingConfigJson>iconSpec.icon)
.render.txt
if (
@ -189,6 +192,10 @@ export default class DetermineLayout {
})
).join(";")
if(!icon){
icon = "./assets/svg/bug.svg"
}
json = {
id: json.id,
description: json.description,