From 88a760846c03cb1f5378391dc9a91b889d968cab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Kv=C3=A1=C4=8Dek?= Date: Thu, 11 Jul 2024 07:26:56 +0200 Subject: [PATCH] Pridana moznost zobrazeni planu v detailu letu --- Dockerfile | 6 +++--- src/components/flights/FlightTrackMap.vue | 21 ++++++++++++++++++- src/graphql/fragments/flight.js | 1 + src/pages/profile/flight/FlightDetailPage.vue | 11 ++++++++-- .../public/pilotProfile/FlightDetailPage.vue | 14 +++++++++---- .../public/pilotProfile/FlightPlanDetail.vue | 2 +- 6 files changed, 44 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 49b3e4d..64a6c4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # develop stage -FROM node:20-alpine as develop-stage +FROM node:20-alpine AS develop-stage ENV TZ=Europe/Prague @@ -12,14 +12,14 @@ RUN npx update-browserslist-db@latest COPY . . # build stage -FROM develop-stage as build-stage +FROM develop-stage AS build-stage ENV NODE_ENV production ENV API_URL "https://api.poletani.cz" ENV GOOGLE_MAPS_API_KEY "AIzaSyAfTU1VntF9rp2D9TR4CFXIMALF5GLgsio" RUN quasar build -m ssr -FROM node:20-alpine as production-stage +FROM node:20-alpine AS production-stage ENV NODE_ENV production ENV TZ=Europe/Prague diff --git a/src/components/flights/FlightTrackMap.vue b/src/components/flights/FlightTrackMap.vue index a9d93d8..5d70a01 100644 --- a/src/components/flights/FlightTrackMap.vue +++ b/src/components/flights/FlightTrackMap.vue @@ -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; +})