mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-07 18:57:50 +00:00
map context menu with coordinates, closes #149
This commit is contained in:
18
website/src/lib/components/CoordinatesPopup.svelte
Normal file
18
website/src/lib/components/CoordinatesPopup.svelte
Normal 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>
|
Reference in New Issue
Block a user