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); +}; + +