Pridana moznost zobrazeni planu v detailu letu

This commit is contained in:
Michal Kváček
2024-07-11 07:26:56 +02:00
parent a8ad8467ce
commit 88a760846c
6 changed files with 44 additions and 11 deletions
+20 -1
View File
@@ -2,12 +2,17 @@
import MapWithMarkers from "components/map/MapWithMarkers.vue";
import {computed, reactive, ref} from "vue";
import {Line} from "vue-chartjs"
import {useFlightPlanUtils} from "src/composables/flightPlan";
const props = defineProps({
flight: {
type: Object,
required: true
},
flightPlan: {
type: Object,
required: false,
},
photos: {
type: Array,
required: false,
@@ -98,15 +103,29 @@ const chartOptions = {
onClick: drawCurrentPositionMarker,
onHover: drawCurrentPositionMarker,
}
const {getMarkersFrom} = useFlightPlanUtils();
const showPlanTrack = ref(true);
const tracks = computed(() => {
const items = [];
if (props.flight.gpxTrack) {
items.push(props.flight.gpxTrack.coordinates)
}
if (showPlanTrack.value && props.flightPlan) {
items.push(getMarkersFrom(props.flightPlan).map(m => ({lat: m.gpsLatitude, lng: m.gpsLongitude})));
}
return items;
})
</script>
<template>
<q-no-ssr>
<q-intersection>
<q-checkbox v-model="showPlanTrack" label="Zobrazovat plán?" v-if="flightPlan" />
<MapWithMarkers
v-if="displayMap"
style="width: 100%; height: 500px;"
:gpx-track="flight.gpxTrack?.coordinates || []"
:tracks="tracks"
:markers="pointsOfInterests"
:highlight-position="currentPositionMarker"
:photos="mapPhotos"