2024-10-08 15:49:14 +02:00
|
|
|
<script lang="ts">
|
2025-02-02 11:17:22 +01:00
|
|
|
import type { TrackPoint } from 'gpx';
|
2025-06-21 21:07:36 +02:00
|
|
|
import CopyCoordinates from '$lib/components/map/gpx-layer/CopyCoordinates.svelte';
|
2025-02-02 11:17:22 +01:00
|
|
|
import * as Card from '$lib/components/ui/card';
|
|
|
|
|
import WithUnits from '$lib/components/WithUnits.svelte';
|
2025-06-21 21:07:36 +02:00
|
|
|
import { Compass, Mountain, Timer } from '@lucide/svelte';
|
|
|
|
|
import { i18n } from '$lib/i18n.svelte';
|
2025-10-23 19:07:32 +02:00
|
|
|
import type { PopupItem } from '$lib/components/map/map-popup';
|
2024-10-08 15:49:14 +02:00
|
|
|
|
2025-06-21 21:07:36 +02:00
|
|
|
let { trackpoint }: { trackpoint: PopupItem<TrackPoint> } = $props();
|
2024-10-08 15:49:14 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<Card.Root class="border-none shadow-md text-base p-2">
|
2025-02-02 11:17:22 +01:00
|
|
|
<Card.Content class="flex flex-col p-0 text-xs gap-1">
|
|
|
|
|
<div class="flex flex-row items-center gap-1">
|
|
|
|
|
<Compass size="14" />
|
|
|
|
|
{trackpoint.item.getLatitude().toFixed(6)}° {trackpoint.item
|
|
|
|
|
.getLongitude()
|
|
|
|
|
.toFixed(6)}°
|
|
|
|
|
</div>
|
|
|
|
|
{#if trackpoint.item.ele !== undefined}
|
|
|
|
|
<div class="flex flex-row items-center gap-1">
|
|
|
|
|
<Mountain size="14" />
|
|
|
|
|
<WithUnits value={trackpoint.item.ele} type="elevation" />
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
{#if trackpoint.item.time}
|
|
|
|
|
<div class="flex flex-row items-center gap-1">
|
|
|
|
|
<Timer size="14" />
|
2025-06-21 21:07:36 +02:00
|
|
|
{i18n.df.format(trackpoint.item.time)}
|
2025-02-02 11:17:22 +01:00
|
|
|
</div>
|
|
|
|
|
{/if}
|
2025-03-22 14:46:16 +01:00
|
|
|
<CopyCoordinates
|
|
|
|
|
coordinates={trackpoint.item.attributes}
|
|
|
|
|
onCopy={() => trackpoint.hide?.()}
|
|
|
|
|
class="mt-0.5"
|
|
|
|
|
/>
|
2025-02-02 11:17:22 +01:00
|
|
|
</Card.Content>
|
2024-10-08 15:49:14 +02:00
|
|
|
</Card.Root>
|