mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-03-15 17:22:59 +00:00
34 lines
1.0 KiB
Svelte
34 lines
1.0 KiB
Svelte
<script lang="ts">
|
|
import { gpxLayers } from '$lib/components/map/gpx-layer/gpx-layers';
|
|
import { onDestroy, onMount } from 'svelte';
|
|
// import { map, gpxLayers } from '$lib/stores';
|
|
// import { GPXLayer } from './gpx-layer';
|
|
import { DistanceMarkers } from '$lib/components/map/gpx-layer/distance-markers';
|
|
import { StartEndMarkers } from '$lib/components/map/gpx-layer/start-end-markers';
|
|
// import { onDestroy } from 'svelte';
|
|
// import { createPopups, removePopups } from './GPXLayerPopup';
|
|
|
|
let distanceMarkers: DistanceMarkers;
|
|
let startEndMarkers: StartEndMarkers;
|
|
|
|
// $: if ($map) {
|
|
// createPopups($map);
|
|
// }
|
|
|
|
onMount(() => {
|
|
gpxLayers.init();
|
|
startEndMarkers = new StartEndMarkers();
|
|
distanceMarkers = new DistanceMarkers();
|
|
});
|
|
|
|
onDestroy(() => {
|
|
// removePopups();
|
|
if (startEndMarkers) {
|
|
startEndMarkers.remove();
|
|
}
|
|
if (distanceMarkers) {
|
|
distanceMarkers.remove();
|
|
}
|
|
});
|
|
</script>
|