Refactoring: move 'GetDefaultIcon' into its own Svelte-class

This commit is contained in:
Pieter Vander Vennet 2025-01-02 03:56:42 +01:00
parent f6ed163554
commit 28f9532af9
13 changed files with 97 additions and 80 deletions

View file

@ -0,0 +1,27 @@
<script lang="ts">
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import DynamicIcon from "./DynamicIcon.svelte"
import DynamicMarker from "./DynamicMarker.svelte"
import Marker from "./Marker.svelte"
import { ImmutableStore } from "../../Logic/UIEventSource"
/**
* The 'DefaultIcon' is the icon that a layer shows by default
* Used e.g. in the filterview
*/
export let layer: LayerConfig
export let properties: Readonly<Record<string, string>> = layer.baseTags
export let clss= ""
let tags = new ImmutableStore(properties)
let mapRenderings = layer.mapRendering?.filter((r) => r.location.has("point"))
</script>
{#if mapRenderings?.length > 0}
<div class={"relative block w-full h-full "+clss}>
{#each mapRenderings as mr}
<DynamicMarker marker={mr.marker} rotation={mr.rotation} {tags} />
{/each}
</div>
{/if}