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" > + { @dragend="handleMarkerMove(i, $event.latLng)" /> + + + + + + {{ marker.bearing }}° + {{ getDuration(marker.distance, flightPlan.plannedSpeed) }}' + + + + + + + + + + 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 @@