mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-12-04 02:42:13 +00:00
progress
This commit is contained in:
@@ -3,20 +3,32 @@
|
||||
import WaypointPopup from '$lib/components/map/gpx-layer/WaypointPopup.svelte';
|
||||
import TrackpointPopup from '$lib/components/map/gpx-layer/TrackpointPopup.svelte';
|
||||
import OverpassPopup from '$lib/components/map/layer-control/OverpassPopup.svelte';
|
||||
import type { PopupItem } from '$lib/components/map/map.svelte';
|
||||
import type { PopupItem } from '$lib/components/map/map-popup';
|
||||
import type { Writable } from 'svelte/store';
|
||||
|
||||
let { item, container = null }: { item: PopupItem | null; container: HTMLDivElement | null } =
|
||||
let {
|
||||
item,
|
||||
onContainerReady,
|
||||
}: { item: Writable<PopupItem | null>; onContainerReady: (div: HTMLDivElement) => void } =
|
||||
$props();
|
||||
|
||||
let container: HTMLDivElement | null = $state(null);
|
||||
|
||||
$effect(() => {
|
||||
if (container) {
|
||||
onContainerReady(container);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div bind:this={container}>
|
||||
{#if item}
|
||||
{#if item.item instanceof Waypoint}
|
||||
<WaypointPopup waypoint={item} />
|
||||
{:else if item.item instanceof TrackPoint}
|
||||
<TrackpointPopup trackpoint={item} />
|
||||
{#if $item}
|
||||
{#if $item.item instanceof Waypoint}
|
||||
<WaypointPopup waypoint={$item} />
|
||||
{:else if $item.item instanceof TrackPoint}
|
||||
<TrackpointPopup trackpoint={$item} />
|
||||
{:else}
|
||||
<OverpassPopup poi={item} />
|
||||
<OverpassPopup poi={$item} />
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user