MapComplete/src/UI/Map/DefaultIcon.svelte

26 lines
882 B
Svelte
Raw Normal View History

<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
2025-01-02 15:34:59 +01:00
export let clss = ""
let tags = new ImmutableStore(properties)
let mapRenderings = layer.mapRendering?.filter((r) => r.location.has("point"))
</script>
{#if mapRenderings?.length > 0}
2025-01-02 15:34:59 +01:00
<div class={"relative block h-full w-full " + clss}>
{#each mapRenderings as mr}
<DynamicMarker marker={mr.marker} rotation={mr.rotation} {tags} />
{/each}
</div>
{/if}