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