From 5280f60f34d7ebc480b3fca8e111299c2af8648a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Tue, 25 Jun 2024 07:39:32 +0200 Subject: [PATCH] Kurzy po planovane trase --- src/components/flightPlans/FlightPlanMap.vue | 47 ++++++++++++++++++-- src/components/map/AirspaceInfoWindow.vue | 14 +++++- src/components/map/MapWrapper.vue | 31 +++++++------ 3 files changed, 74 insertions(+), 18 deletions(-) diff --git a/src/components/flightPlans/FlightPlanMap.vue b/src/components/flightPlans/FlightPlanMap.vue index bb8e6df..740390b 100644 --- a/src/components/flightPlans/FlightPlanMap.vue +++ b/src/components/flightPlans/FlightPlanMap.vue @@ -2,7 +2,7 @@ import {computed, ref, watch} from "vue"; import {Marker, CustomMarker, Polyline} from "vue3-google-map"; import MapWrapper from "components/map/MapWrapper.vue"; -import {useFlightPlanObjects, useFlightPlanUtils} from "src/composables/flightPlan"; +import {useFlightPlanCalculations, useFlightPlanObjects, useFlightPlanUtils} from "src/composables/flightPlan"; import {useGeocode} from "src/composables/geocoding"; const props = defineProps({ @@ -26,7 +26,7 @@ const props = defineProps({ type: Number, required: false, default: null - } + }, }); const emits = defineEmits(["markers-changed", "change-insert-position"]); @@ -34,6 +34,7 @@ const {center} = useGeocode(); const {markerObject, googleMapsMarkerObject, editableNameTypes} = useFlightPlanObjects(); const {getMarkersFrom} = useFlightPlanUtils(); +const {getDuration} = useFlightPlanCalculations(); const mapWrap = ref(null); @@ -47,7 +48,18 @@ watch(() => props.flightPlan.track, (newVal) => { }, {immediate: true, deep: true}); const track = computed(() => markers.value.map(m => ({lat: m.gpsLatitude, lng: m.gpsLongitude}))); - +const trackAids = computed(() => props.flightPlan.track.map(p => ({ + ...p, + anchorPoint: 'CENTER', + bearing: p.bearing, + distance: p.distance, + position: { + lat: (p.from.gpsLatitude + p.to.gpsLatitude) / 2, + lng: (p.from.gpsLongitude + p.to.gpsLongitude) / 2 + } + } +))); +const displayTrackAids = ref(true); const addMarker = async (point) => { if (!point) return; @@ -98,6 +110,7 @@ const handleMarkerMove = async (idx, event) => { @remove-from-route="removeMarker" > + + + + + + diff --git a/src/components/map/AirspaceInfoWindow.vue b/src/components/map/AirspaceInfoWindow.vue index edf1651..d4a166a 100644 --- a/src/components/map/AirspaceInfoWindow.vue +++ b/src/components/map/AirspaceInfoWindow.vue @@ -1,5 +1,5 @@