2025-06-21 21:07:36 +02:00
|
|
|
<script lang="ts">
|
2025-10-23 19:07:32 +02:00
|
|
|
import { map } from '$lib/components/map/map';
|
|
|
|
|
import { trackpointPopup } from '$lib/components/map/gpx-layer/gpx-layer-popup';
|
2025-06-21 21:07:36 +02:00
|
|
|
|
2025-10-23 19:07:32 +02:00
|
|
|
map.onLoad((map_) => {
|
|
|
|
|
map_.on('contextmenu', (e) => {
|
2026-02-14 15:05:23 +01:00
|
|
|
if (
|
|
|
|
|
map_.queryRenderedFeatures(e.point, {
|
|
|
|
|
layers: map_
|
|
|
|
|
.getLayersOrder()
|
|
|
|
|
.filter((layerId) => layerId.startsWith('routing-controls')),
|
|
|
|
|
}).length
|
|
|
|
|
) {
|
2026-02-14 14:35:35 +01:00
|
|
|
// Clicked on routing control, ignoring
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-10-23 19:07:32 +02:00
|
|
|
trackpointPopup?.setItem({
|
2026-10-04 17:09:41 +02:00
|
|
|
kind: 'trackpoint',
|
|
|
|
|
item: { lng: e.lngLat.lng, lat: e.lngLat.lat },
|
2025-06-21 21:07:36 +02:00
|
|
|
});
|
2025-10-23 19:07:32 +02:00
|
|
|
});
|
2025-06-21 21:07:36 +02:00
|
|
|
});
|
|
|
|
|
</script>
|