2024-10-08 15:49:14 +02:00
|
|
|
<svelte:options accessors />
|
|
|
|
|
|
|
|
<script lang="ts">
|
2025-02-02 11:17:22 +01:00
|
|
|
import { TrackPoint, Waypoint } from 'gpx';
|
|
|
|
import type { Writable } from 'svelte/store';
|
|
|
|
import WaypointPopup from '$lib/components/gpx-layer/WaypointPopup.svelte';
|
|
|
|
import TrackpointPopup from '$lib/components/gpx-layer/TrackpointPopup.svelte';
|
|
|
|
import OverpassPopup from '$lib/components/layer-control/OverpassPopup.svelte';
|
|
|
|
import type { PopupItem } from './MapPopup';
|
2024-10-08 15:49:14 +02:00
|
|
|
|
2025-02-02 11:17:22 +01:00
|
|
|
export let item: Writable<PopupItem | null>;
|
|
|
|
export let container: HTMLDivElement | null = null;
|
2024-10-08 15:49:14 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<div bind:this={container}>
|
2025-02-02 11:17:22 +01:00
|
|
|
{#if $item}
|
|
|
|
{#if $item.item instanceof Waypoint}
|
|
|
|
<WaypointPopup waypoint={$item} />
|
|
|
|
{:else if $item.item instanceof TrackPoint}
|
|
|
|
<TrackpointPopup trackpoint={$item} />
|
|
|
|
{:else}
|
|
|
|
<OverpassPopup poi={$item} />
|
|
|
|
{/if}
|
|
|
|
{/if}
|
2024-10-08 15:49:14 +02:00
|
|
|
</div>
|