Test jineho vycitani z gpx
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import {flight} from "src/composables/objects/flight";
|
import {flight} from "src/composables/objects/flight";
|
||||||
import MapWithMarkers from "components/map/MapWithMarkers.vue";
|
import MapWithMarkers from "components/map/MapWithMarkers.vue";
|
||||||
import {computed} from "vue";
|
import {computed, ref} from "vue";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
flight: {
|
flight: {
|
||||||
@@ -15,13 +15,16 @@ const trackWithGPS = computed(() => {
|
|||||||
return flight.value.track.filter(poi => poi.pointOfInterest.gpsLatitude && poi.pointOfInterest.gpsLongitude)
|
return flight.value.track.filter(poi => poi.pointOfInterest.gpsLatitude && poi.pointOfInterest.gpsLongitude)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const slider = ref(0);
|
||||||
|
|
||||||
|
|
||||||
const pointsOfInterests = computed(() => {
|
const pointsOfInterests = computed(() => {
|
||||||
const path = [{
|
const path = [{
|
||||||
label: flight.value.takeoffAirport.name,
|
label: flight.value.takeoffAirport.name,
|
||||||
position:
|
position:
|
||||||
{
|
{
|
||||||
lat: flight.value.takeoffAirport.gpsLatitude,
|
lat: flight.value.takeoffAirport.gpsLatitude + (slider.value / 1000),
|
||||||
lng: flight.value.takeoffAirport.gpsLongitude
|
lng: flight.value.takeoffAirport.gpsLongitude + (slider.value / 1000)
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@@ -56,6 +59,7 @@ const displayMap = computed(() => {
|
|||||||
flight.value.landingAirport.id !== flight.value.takeoffAirport.id
|
flight.value.landingAirport.id !== flight.value.takeoffAirport.id
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -66,4 +70,10 @@ const displayMap = computed(() => {
|
|||||||
:markers="pointsOfInterests"
|
:markers="pointsOfInterests"
|
||||||
:photos="mapPhotos"
|
:photos="mapPhotos"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{{ pointsOfInterests }}
|
||||||
|
|
||||||
|
{{ slider }}
|
||||||
|
|
||||||
|
<q-slider v-model.number="slider" :min="-100" :max="100" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ const props = defineProps({
|
|||||||
|
|
||||||
const track = ref([]);
|
const track = ref([]);
|
||||||
const gpxLoading = ref(!!props.gpxTrackUrl);
|
const gpxLoading = ref(!!props.gpxTrackUrl);
|
||||||
|
const speed = ref([]);
|
||||||
|
const elevation = ref([]);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
if (!props.gpxTrackUrl) {
|
if (!props.gpxTrackUrl) {
|
||||||
return;
|
return;
|
||||||
@@ -37,7 +39,12 @@ onMounted(() => {
|
|||||||
nodes.forEach(node => {
|
nodes.forEach(node => {
|
||||||
const lat = parseFloat(node.getAttribute("lat"));
|
const lat = parseFloat(node.getAttribute("lat"));
|
||||||
const lng = parseFloat(node.getAttribute("lon"));
|
const lng = parseFloat(node.getAttribute("lon"));
|
||||||
|
|
||||||
|
console.log(node.childNodes);
|
||||||
|
|
||||||
points.push({lat, lng});
|
points.push({lat, lng});
|
||||||
|
// speed.value.push(node.getElementsByTagName("extensions").getElementsByTagName("speed"));
|
||||||
|
// elevation.value.push(node.getElementsByTagName("ele").innerText);
|
||||||
})
|
})
|
||||||
|
|
||||||
track.value = points; // puvodne se bounds bralo z tohodle
|
track.value = points; // puvodne se bounds bralo z tohodle
|
||||||
@@ -54,7 +61,11 @@ const bounds = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="gpxLoading" v-bind="$attrs">Loading</div>
|
<q-spinner v-if="gpxLoading" v-bind="$attrs" />
|
||||||
|
|
||||||
|
speed: {{ speed }}
|
||||||
|
elevation: {{ elevation }}
|
||||||
|
|
||||||
<MapWrapper v-bind="$attrs" :bounds="bounds" v-if="!gpxLoading">
|
<MapWrapper v-bind="$attrs" :bounds="bounds" v-if="!gpxLoading">
|
||||||
<Marker v-for="(marker, idx) in markers" :key="idx" :options="marker"/>
|
<Marker v-for="(marker, idx) in markers" :key="idx" :options="marker"/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user