2024-04-25 13:48:31 +02:00
|
|
|
<script lang="ts">
|
2025-10-17 23:54:45 +02:00
|
|
|
import { gpxLayers } from '$lib/components/map/gpx-layer/gpx-layers';
|
2025-10-19 14:15:52 +02:00
|
|
|
import { onDestroy, onMount } from 'svelte';
|
2025-10-17 23:54:45 +02:00
|
|
|
// import { map, gpxLayers } from '$lib/stores';
|
|
|
|
|
// import { GPXLayer } from './gpx-layer';
|
2025-10-19 14:15:52 +02:00
|
|
|
import { DistanceMarkers } from '$lib/components/map/gpx-layer/distance-markers';
|
|
|
|
|
import { StartEndMarkers } from '$lib/components/map/gpx-layer/start-end-markers';
|
2025-10-17 23:54:45 +02:00
|
|
|
// import { onDestroy } from 'svelte';
|
|
|
|
|
// import { createPopups, removePopups } from './GPXLayerPopup';
|
2024-05-23 11:21:57 +02:00
|
|
|
|
2025-10-19 14:15:52 +02:00
|
|
|
let distanceMarkers: DistanceMarkers;
|
|
|
|
|
let startEndMarkers: StartEndMarkers;
|
2024-04-25 13:48:31 +02:00
|
|
|
|
2025-10-17 23:54:45 +02:00
|
|
|
// $: if ($map) {
|
|
|
|
|
// createPopups($map);
|
|
|
|
|
// }
|
2024-04-25 13:48:31 +02:00
|
|
|
|
2025-10-17 23:54:45 +02:00
|
|
|
onMount(() => {
|
|
|
|
|
gpxLayers.init();
|
2025-10-19 14:15:52 +02:00
|
|
|
startEndMarkers = new StartEndMarkers();
|
|
|
|
|
distanceMarkers = new DistanceMarkers();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
onDestroy(() => {
|
|
|
|
|
// removePopups();
|
|
|
|
|
if (startEndMarkers) {
|
|
|
|
|
startEndMarkers.remove();
|
|
|
|
|
}
|
|
|
|
|
if (distanceMarkers) {
|
|
|
|
|
distanceMarkers.remove();
|
|
|
|
|
}
|
2025-02-02 11:17:22 +01:00
|
|
|
});
|
2024-04-25 13:48:31 +02:00
|
|
|
</script>
|