mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-02-07 00:43:10 +00:00
fix coordinates popup
This commit is contained in:
@@ -1,20 +1,18 @@
|
||||
<script lang="ts">
|
||||
import { map } from '$lib/components/map/map.svelte';
|
||||
import { trackpointPopup } from '$lib/components/map/gpx-layer/GPXLayerPopup';
|
||||
import { map } from '$lib/components/map/map';
|
||||
import { trackpointPopup } from '$lib/components/map/gpx-layer/gpx-layer-popup';
|
||||
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,
|
||||
},
|
||||
}),
|
||||
});
|
||||
map.onLoad((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