map context menu with coordinates, closes #149

This commit is contained in:
vcoppe
2025-01-25 12:31:12 +01:00
parent e02a22eaea
commit d19e702084
5 changed files with 41 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
<script lang="ts">
import { map } from '$lib/stores';
import { trackpointPopup } from '$lib/components/gpx-layer/GPXLayerPopup';
import { TrackPoint } from 'gpx';
$: if ($map) {
$map.on('contextmenu', (e) => {
trackpointPopup?.setItem({
item: new TrackPoint({
attributes: {
lat: e.lngLat.lat,
lon: e.lngLat.lng
}
})
});
});
}
</script>