2024-10-08 15:49:14 +02:00
|
|
|
<script lang="ts">
|
2025-02-02 11:17:22 +01:00
|
|
|
import type { TrackPoint } from 'gpx';
|
|
|
|
import type { PopupItem } from '$lib/components/MapPopup';
|
2025-03-22 14:46:16 +01:00
|
|
|
import CopyCoordinates from '$lib/components/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-03-22 14:46:16 +01:00
|
|
|
import { Compass, Mountain, Timer } from 'lucide-svelte';
|
2025-02-02 11:17:22 +01:00
|
|
|
import { df } from '$lib/utils';
|
|
|
|
import { _ } from 'svelte-i18n';
|
2024-10-08 15:49:14 +02:00
|
|
|
|
2025-02-02 11:17:22 +01:00
|
|
|
export let trackpoint: PopupItem<TrackPoint>;
|
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.Header class="p-0">
|
|
|
|
<Card.Title class="text-md"></Card.Title>
|
|
|
|
</Card.Header>
|
|
|
|
<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" />
|
|
|
|
{df.format(trackpoint.item.time)}
|
|
|
|
</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>
|