2023-10-11 04:16:52 +02:00
|
|
|
<script lang="ts">
|
2023-12-01 15:23:28 +01:00
|
|
|
import { IconConfig } from "../../Models/ThemeConfig/PointRenderingConfig"
|
|
|
|
import { ImmutableStore, Store } from "../../Logic/UIEventSource"
|
|
|
|
import DynamicIcon from "./DynamicIcon.svelte"
|
|
|
|
import TagRenderingConfig from "../../Models/ThemeConfig/TagRenderingConfig"
|
2023-12-24 05:01:10 +01:00
|
|
|
import { Orientation } from "../../Sensors/Orientation"
|
2023-10-11 04:16:52 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders a 'marker', which consists of multiple 'icons'
|
|
|
|
*/
|
2023-12-24 05:01:10 +01:00
|
|
|
export let marker: IconConfig[]
|
2023-12-01 15:23:28 +01:00
|
|
|
export let tags: Store<Record<string, string>>
|
2023-12-19 22:08:00 +01:00
|
|
|
export let rotation: TagRenderingConfig = undefined
|
2023-12-24 05:01:10 +01:00
|
|
|
let _rotation: Store<string> = rotation
|
2023-12-01 15:23:28 +01:00
|
|
|
? tags.map((tags) => rotation.GetRenderValue(tags).Subs(tags).txt)
|
2023-12-24 05:01:10 +01:00
|
|
|
: new ImmutableStore("0deg")
|
|
|
|
if(rotation?.render?.txt === "{alpha}deg"){
|
|
|
|
_rotation = Orientation.singleton.alpha.map(alpha => alpha ? (alpha)+"deg" : "0deg ")
|
|
|
|
}
|
2023-10-11 04:16:52 +02:00
|
|
|
</script>
|
2023-11-09 16:30:26 +01:00
|
|
|
|
2023-11-19 04:38:34 +01:00
|
|
|
{#if marker && marker}
|
|
|
|
<div class="relative h-full w-full" style={`transform: rotate(${$_rotation})`}>
|
|
|
|
{#each marker as icon}
|
2023-11-22 19:39:19 +01:00
|
|
|
<div class="absolute top-0 left-0 h-full w-full">
|
|
|
|
<DynamicIcon {icon} {tags} />
|
|
|
|
</div>
|
2023-10-11 04:16:52 +02:00
|
|
|
{/each}
|
|
|
|
</div>
|
|
|
|
{/if}
|