Ve verejne casti s detailem planu ukazovat jen pouzite POI

This commit is contained in:
Michal Kváček
2024-06-30 02:38:31 +02:00
parent ba1089af3d
commit a8ad8467ce
@@ -20,7 +20,7 @@ import {useAirspacesStore} from "stores/Airspaces";
import {usePointsOfInterestStore} from "stores/PointsOfInterest"; import {usePointsOfInterestStore} from "stores/PointsOfInterest";
import {useAirportsStore} from "stores/Airports"; import {useAirportsStore} from "stores/Airports";
import {formatDatetime, minutesToHumanReadable} from "src/composables/datetimeUtils"; import {formatDatetime, minutesToHumanReadable} from "src/composables/datetimeUtils";
import {useFlightPlanCalculations} from "src/composables/flightPlan"; import {useFlightPlanCalculations, useFlightPlanUtils} from "src/composables/flightPlan";
import FlightPlanRouteTable from "components/flightPlans/FlightPlanRouteTable.vue"; import FlightPlanRouteTable from "components/flightPlans/FlightPlanRouteTable.vue";
import {useMeta} from "quasar"; import {useMeta} from "quasar";
import {metaData} from "src/composables/meta"; import {metaData} from "src/composables/meta";
@@ -56,6 +56,13 @@ const {pointsOfInterest} = storeToRefs(usePointsOfInterestStore());
const {airspaces: airspacesData, areAirspacesLoading: isQueryRunning} = storeToRefs(useAirspacesStore()) const {airspaces: airspacesData, areAirspacesLoading: isQueryRunning} = storeToRefs(useAirspacesStore())
const {airports} = storeToRefs(useAirportsStore()); const {airports} = storeToRefs(useAirportsStore());
const {getMarkersFrom} = useFlightPlanUtils();
const usedPointsOfInterest = computed(() => {
const poisInTrackIds = getMarkersFrom(flightPlan.value).filter(m => !!m.pointOfInterestId).map(poi => poi.id);
return pointsOfInterest.value.filter(poi => poisInTrackIds.includes(poi.id))
});
const openedTab = ref("map"); const openedTab = ref("map");
const {getTotalDistance, getTotalDuration} = useFlightPlanCalculations(); const {getTotalDistance, getTotalDuration} = useFlightPlanCalculations();
@@ -75,7 +82,7 @@ const showInfoCard = computed(() => flightPlan.value.aircraft || flightPlan.valu
<FlightPlanMap <FlightPlanMap
:airspace-data="airspacesData" :airspace-data="airspacesData"
:airports="airports" :airports="airports"
:points-of-interest="pointsOfInterest" :points-of-interest="usedPointsOfInterest"
:flight-plan="flightPlan" :flight-plan="flightPlan"
/> />
<div class="row"> <div class="row">