mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-07 18:57:50 +00:00
19 lines
382 B
Svelte
19 lines
382 B
Svelte
![]() |
<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>
|