Files
gpx.studio/website/src/lib/components/map/CoordinatesPopup.svelte

19 lines
548 B
Svelte
Raw Normal View History

2025-06-21 21:07:36 +02:00
<script lang="ts">
2025-10-23 19:07:32 +02:00
import { map } from '$lib/components/map/map';
import { trackpointPopup } from '$lib/components/map/gpx-layer/gpx-layer-popup';
2025-06-21 21:07:36 +02:00
import { TrackPoint } from 'gpx';
2025-10-23 19:07:32 +02:00
map.onLoad((map_) => {
map_.on('contextmenu', (e) => {
trackpointPopup?.setItem({
item: new TrackPoint({
attributes: {
lat: e.lngLat.lat,
lon: e.lngLat.lng,
},
}),
2025-06-21 21:07:36 +02:00
});
2025-10-23 19:07:32 +02:00
});
2025-06-21 21:07:36 +02:00
});
</script>