From b5703671423eea51231d687494053e15f8179294 Mon Sep 17 00:00:00 2001 From: p11037 Date: Wed, 29 Nov 2023 21:43:05 +0700 Subject: [PATCH 1/3] front_get --- src/views/Favorite.vue | 140 ++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 78 deletions(-) diff --git a/src/views/Favorite.vue b/src/views/Favorite.vue index 1d457d7..7146f57 100644 --- a/src/views/Favorite.vue +++ b/src/views/Favorite.vue @@ -1,79 +1,63 @@ - - - - \ No newline at end of file +
+

My Favorites

+ +
+ + + + + + \ No newline at end of file From 19ba190ced1bc9d42f741f99a52ab1271bdf478a Mon Sep 17 00:00:00 2001 From: p11037 Date: Thu, 30 Nov 2023 00:07:02 +0700 Subject: [PATCH 2/3] show each data for favorites page --- src/components/DestinationInfoCard.vue | 6 +- src/views/Favorite.vue | 113 ++++++++++++------------- 2 files changed, 57 insertions(+), 62 deletions(-) diff --git a/src/components/DestinationInfoCard.vue b/src/components/DestinationInfoCard.vue index 6489999..e166731 100644 --- a/src/components/DestinationInfoCard.vue +++ b/src/components/DestinationInfoCard.vue @@ -37,7 +37,7 @@ {{nearestStructureData.lon}} , {{nearestStructureData.lat}} - + @@ -254,7 +254,7 @@ export default { if (this.isLocationRequested && !this.userLocation) { return 'Requesting location...'; } else if (this.userLocation) { - return `${this.userLocation.lat.toFixed(6)}, ${this.userLocation.lon.toFixed(6)}`; + return `${this.userLocation.lon.toFixed(6)}, ${this.userLocation.lat.toFixed(6)}`; } return 'Location not available'; }, diff --git a/src/views/Favorite.vue b/src/views/Favorite.vue index 7146f57..521fe44 100644 --- a/src/views/Favorite.vue +++ b/src/views/Favorite.vue @@ -1,63 +1,58 @@ - - - - - \ No newline at end of file +}; + + + From cea70a1d42b7da791d6d08c2296a13010cc57d81 Mon Sep 17 00:00:00 2001 From: SRP-mango Date: Thu, 30 Nov 2023 19:55:56 +0700 Subject: [PATCH 3/3] emit data from destCard to Home --- src/components/DestinationInfoCard.vue | 1 + src/views/Home.vue | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/DestinationInfoCard.vue b/src/components/DestinationInfoCard.vue index e166731..bce9749 100644 --- a/src/components/DestinationInfoCard.vue +++ b/src/components/DestinationInfoCard.vue @@ -282,6 +282,7 @@ export default { lon: position.coords.longitude }; console.log('User Location:', this.userLocation); + this.$emit('updateLocation', this.userLocation); }, handleLocationError(error) { console.error('Error getting location:', error); diff --git a/src/views/Home.vue b/src/views/Home.vue index 71bf7c1..eae7370 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -10,7 +10,7 @@ v-if="popupData" :nearestStructureData="popupData" :onClose="closePopup" - + @updateLocation="handleUserLocation" /> @@ -94,6 +94,7 @@ import { ref } from "vue"; import axios from "axios"; import DestinationInfoCard from '@/components/DestinationInfoCard.vue'; + const center = ref([100.538611, 13.764722]); const projection = ref("EPSG:4326"); const zoom = ref(19); @@ -151,6 +152,11 @@ const closePopup = () => { popupData.value = null; // Hide popup }; +const handleUserLocation = (location) => { + console.log("Received user location:", location); +}; + +