Fix vykreslovani mapy
This commit is contained in:
@@ -13,20 +13,16 @@ const props = defineProps({
|
||||
|
||||
|
||||
const mapPhotos = computed(() => flight.value.photos.filter(photo => photo.gpsLatitude && photo.gpsLongitude));
|
||||
const poisWithGPS = computed(() => {
|
||||
return flight.value.track.filter(poi => {
|
||||
const item = poi.pointOfInterest || poi.airport;
|
||||
return item.gpsLatitude && item.gpsLongitude;
|
||||
}).map(poi => poi.pointOfInterest || poi.airport)
|
||||
});
|
||||
const poisWithGPS = computed(() => flight.value.track.map(poi => poi.pointOfInterest || poi.airport));
|
||||
|
||||
const mapMarkers = [flight.value.takeoffAirport].concat(poisWithGPS.value).concat([flight.value.landingAirport]);
|
||||
const pointsOfInterests = computed(() => mapMarkers.map(
|
||||
const pointsOfInterests = computed(() => mapMarkers
|
||||
.filter(marker => marker.gpsLatitude && marker.gpsLongiture)
|
||||
.map(
|
||||
marker => ({label: marker.name, position: {lat: marker.gpsLatitude, lng: marker.gpsLongitude}})
|
||||
));
|
||||
));
|
||||
|
||||
const gpxTrack = flight.value.gpxTrack;
|
||||
|
||||
const displayMap = computed(() => {
|
||||
return (
|
||||
!!gpxTrack ||
|
||||
@@ -80,7 +76,7 @@ if (gpxTrack) {
|
||||
|
||||
const currentPositionMarker = ref(null);
|
||||
const drawCurrentPositionMarker = (e) => {
|
||||
const res = e.chart.getElementsAtEventForMode(e, 'nearest', {intersect: false},);
|
||||
const res = e.chart.getElementsAtEventForMode(e, 'nearest', {intersect: false});
|
||||
if (res.length === 0) {
|
||||
currentPositionMarker.value = null;
|
||||
return;
|
||||
|
||||
@@ -74,7 +74,7 @@ watch(() => props.flight.track, (newVal) => {
|
||||
<template>
|
||||
<FormWrapper v-model="formData">
|
||||
|
||||
<q-banner class="bg-green text-white" v-if="flight.gpxTrackUrl">
|
||||
<q-banner class="bg-green text-white" v-if="flight.gpxTrack">
|
||||
<q-icon name="check"/>
|
||||
Trasa nahrána
|
||||
</q-banner>
|
||||
|
||||
@@ -47,7 +47,6 @@ fragment flightFullInfo on Flight {
|
||||
name
|
||||
}
|
||||
|
||||
gpxTrackUrl
|
||||
gpxTrack {
|
||||
coordinates {
|
||||
lat
|
||||
|
||||
Reference in New Issue
Block a user