MapComplete/src/UI/Map/Marker.svelte

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

25 lines
630 B
Svelte
Raw Normal View History

<script lang="ts">
2023-12-19 22:08:00 +01:00
import Icon from "./Icon.svelte"
2024-06-18 17:55:47 +02:00
import { twMerge } from "tailwind-merge"
/**
* Renders a 'marker', which consists of multiple 'icons'
*/
2023-12-19 22:08:00 +01:00
export let icons: { icon: string; color: string }[]
2024-06-18 17:55:47 +02:00
/**
* Class which is applied onto the individual icons
*/
export let clss = ""
export let size = "w-full h-full"
2023-10-07 03:07:32 +02:00
</script>
2023-11-09 16:30:26 +01:00
{#if icons !== undefined && icons.length > 0}
2024-06-18 17:55:47 +02:00
<div class={twMerge("relative", size)}>
2023-10-07 03:07:32 +02:00
{#each icons as icon}
2023-11-22 19:39:19 +01:00
<div class="absolute top-0 left-0 h-full w-full">
2024-06-18 17:55:47 +02:00
<Icon icon={icon.icon} color={icon.color} {clss} />
2023-11-22 19:39:19 +01:00
</div>
2023-10-07 03:07:32 +02:00
{/each}
</div>
{/if}