MapComplete/src/UI/Map/DynamicMarker.svelte

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
721 B
Svelte
Raw Normal View History

<script lang="ts">
2023-11-09 16:30:26 +01:00
import PointRenderingConfig, { IconConfig } from "../../Models/ThemeConfig/PointRenderingConfig"
import { Store } from "../../Logic/UIEventSource"
import DynamicIcon from "./DynamicIcon.svelte"
/**
* Renders a 'marker', which consists of multiple 'icons'
*/
2023-11-09 16:30:26 +01:00
export let config: PointRenderingConfig
let icons: IconConfig[] = config.marker
export let tags: Store<Record<string, string>>
2023-11-14 16:24:39 +01:00
let rotation = tags.map(tags => config.rotation.GetRenderValue(tags).Subs(tags).txt)
</script>
2023-11-09 16:30:26 +01:00
{#if config !== undefined}
2023-11-14 16:24:39 +01:00
<div class="relative h-full w-full" style={`transform: rotate(${$rotation})`}>
{#each icons as icon}
<DynamicIcon {icon} {tags} />
{/each}
</div>
{/if}