MapComplete/src/UI/Map/DynamicIcon.svelte

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

21 lines
687 B
Svelte
Raw Normal View History

<script lang="ts">
2023-11-22 19:39:19 +01:00
import { IconConfig } from "../../Models/ThemeConfig/PointRenderingConfig";
import { Store } from "../../Logic/UIEventSource";
import Icon from "./Icon.svelte";
/**
* Renders a single icon.
*
* Icons -placed on top of each other- form a 'Marker' together
*/
2023-11-09 16:30:26 +01:00
export let icon: IconConfig
export let tags: Store<Record<string, string>>
2023-11-11 11:33:29 +01:00
let iconItem = icon.icon?.GetRenderValue($tags)?.Subs($tags)?.txt
$: iconItem = icon.icon?.GetRenderValue($tags)?.Subs($tags)?.txt
2023-11-09 16:30:26 +01:00
let color = icon.color?.GetRenderValue(tags)?.txt ?? "#000000"
$: color = icon.color?.GetRenderValue($tags)?.txt ?? "#000000"
</script>
2023-11-09 16:30:26 +01:00
<Icon icon={iconItem} {color} />