Themes(toilets): improve tagging of wheelchair accessible toilets, various fixes to make this possible

This commit is contained in:
Pieter Vander Vennet 2025-04-05 04:01:19 +02:00
parent 1e84c2cc4d
commit 089017b136
19 changed files with 617 additions and 223 deletions

View file

@ -17,7 +17,10 @@
export let layer: LayerConfig
let headerTr = layer.tagRenderings.find((tr) => tr.id === header)
let trgs: TagRenderingConfig[] = []
if (headerTr === undefined) {
console.error("Header tagRendering with ID", header, "was not found")
}
let tagRenderings: TagRenderingConfig[] = []
let seenIds = new Set<string>()
for (const label of labels) {
for (const tr of layer.tagRenderings) {
@ -25,20 +28,30 @@
continue
}
if (label === tr.id || tr.labels.some((l) => l === label)) {
trgs.push(tr)
tagRenderings.push(tr)
seenIds.add(tr.id)
}
}
}
</script>
<AccordionSingle>
{#if tagRenderings.length > 0}
<div class="mb-8">
<AccordionSingle>
<div slot="header">
<TagRenderingAnswer {tags} {layer} config={headerTr} {state} {selectedElement} />
{#if headerTr}
<TagRenderingAnswer {tags} {layer} config={headerTr} {state} {selectedElement} />
{:else}
{header}
{/if}
</div>
{#each trgs as config (config.id)}
{#each tagRenderings as config (config.id)}
{#if config.IsKnown($tags) && (config.condition === undefined || config.condition.matchesProperties($tags))}
<TagRenderingEditableDynamic {tags} {config} {state} {selectedElement} {layer} />
{/if}
{/each}
</AccordionSingle>
</div>
{/if}