mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-02-06 08:23:09 +00:00
19 lines
548 B
Svelte
19 lines
548 B
Svelte
<script lang="ts">
|
|
import { map } from '$lib/components/map/map';
|
|
import { trackpointPopup } from '$lib/components/map/gpx-layer/gpx-layer-popup';
|
|
import { TrackPoint } from 'gpx';
|
|
|
|
map.onLoad((map_) => {
|
|
map_.on('contextmenu', (e) => {
|
|
trackpointPopup?.setItem({
|
|
item: new TrackPoint({
|
|
attributes: {
|
|
lat: e.lngLat.lat,
|
|
lon: e.lngLat.lng,
|
|
},
|
|
}),
|
|
});
|
|
});
|
|
});
|
|
</script>
|