新增点击地点标点,弹窗地点信息弹窗功能
This commit is contained in:
24
src/stores/flyto.js
Normal file
24
src/stores/flyto.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { isLnglat } from '/@/api/util'
|
||||
|
||||
|
||||
export const useFlytoStore = defineStore({
|
||||
id: 'flyto',
|
||||
state: () => ({
|
||||
lng: NaN,
|
||||
lat: NaN,
|
||||
}),
|
||||
getters: {
|
||||
value: (state) => { state.lng, state.lat }
|
||||
},
|
||||
actions: {
|
||||
set(flyto) {
|
||||
if ( !isLnglat(flyto) ) return false
|
||||
|
||||
this.lng = flyto.lng
|
||||
this.lat = flyto.lat
|
||||
|
||||
return true
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user