check in check out
This commit is contained in:
parent
f81f138c63
commit
308b9d0617
2 changed files with 25 additions and 5 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue