show hovered point on elevation profile

This commit is contained in:
vcoppe committed 2026-11-08 15:06:03 +01:00
1 parent b80fa7d942
commit 21e27a4416
15 files changed
+260 -106

No files matched your search

@@ -5,6 +5,7 @@
import { StartEndMarkers } from '$lib/components/map/gpx-layer/start-end-markers';
import { createPopups, removePopups } from '$lib/components/map/gpx-layer/gpx-layer-popup';
import { map } from '$lib/components/map/map';
import { hoveredTrackpoint } from '$lib/state/selection-statistics';
let distanceMarkers: DistanceMarkers;
let startEndMarkers: StartEndMarkers;
@@ -14,6 +15,11 @@
startEndMarkers = new StartEndMarkers();
distanceMarkers = new DistanceMarkers();
createPopups(map_);
// the layers do not see the pointer when it leaves the map or when it drags something
const stopHovering = () => hoveredTrackpoint.set(null);
map_.on('mouseout', stopHovering);
map_.on('mousedown', stopHovering);
map_.on('movestart', stopHovering);
});
onDestroy(() => {