check in check out

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-08 14:24:53 +07:00
parent f81f138c63
commit 308b9d0617
2 changed files with 25 additions and 5 deletions

View file

@ -4,6 +4,13 @@ import { loadModules } from 'esri-loader'
import axios from 'axios'
import type { LocationObject } from '@/interface/index/Main'
const emit = defineEmits(['update:location'])
function updateLocation(latitude: any, longitude: any, namePOI: string) {
// event parent component props
emit('update:location', latitude, longitude, namePOI)
}
const currentPosition = ref<LocationObject>()
const poiPlaceName = ref<string>('')
@ -103,6 +110,8 @@ async function initializeMap() {
poiPlaceName.value = response.data.address
? response.data.address.PlaceName
: 'ไม่พบข้อมูล'
updateLocation(latitude, longitude, poiPlaceName.value)
})
.catch((error) => {
console.error('Error fetching points of interest:', error)