mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-02-06 16:33:09 +00:00
21 lines
630 B
Svelte
21 lines
630 B
Svelte
|
|
<script lang="ts">
|
||
|
|
import { map } from '$lib/components/map/map.svelte';
|
||
|
|
import { trackpointPopup } from '$lib/components/map/gpx-layer/GPXLayerPopup';
|
||
|
|
import { TrackPoint } from 'gpx';
|
||
|
|
|
||
|
|
$effect(() => {
|
||
|
|
if (map.current) {
|
||
|
|
map.current.on('contextmenu', (e) => {
|
||
|
|
trackpointPopup?.setItem({
|
||
|
|
item: new TrackPoint({
|
||
|
|
attributes: {
|
||
|
|
lat: e.lngLat.lat,
|
||
|
|
lon: e.lngLat.lng,
|
||
|
|
},
|
||
|
|
}),
|
||
|
|
});
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
</script>
|