Test jineho vycitani z gpx

This commit is contained in:
Michal Kváček
2023-08-28 06:35:20 +02:00
parent dcc3230cbe
commit 06764904b4
2 changed files with 25 additions and 4 deletions
+12 -1
View File
@@ -24,6 +24,8 @@ const props = defineProps({
const track = ref([]);
const gpxLoading = ref(!!props.gpxTrackUrl);
const speed = ref([]);
const elevation = ref([]);
onMounted(() => {
if (!props.gpxTrackUrl) {
return;
@@ -37,7 +39,12 @@ onMounted(() => {
nodes.forEach(node => {
const lat = parseFloat(node.getAttribute("lat"));
const lng = parseFloat(node.getAttribute("lon"));
console.log(node.childNodes);
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
@@ -54,7 +61,11 @@ const bounds = computed(() => {
</script>
<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">
<Marker v-for="(marker, idx) in markers" :key="idx" :options="marker"/>