You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GCSGUI/src/store/layerManagerStore.ts

38 lines
1.1 KiB
TypeScript

import {defineStore} from "pinia";
import {Airline} from "@/types/entityoptions.ts";
type layer = {
lName: string
lId: string
dataSource?: any
imageLayer?: any
show: boolean
}
export const useLayerStore = defineStore('LayerStore', {
state: ()=>{
return {
Layers: [] as layer[],
navi: {
airlines: [] as Airline[],
currentRouteID: undefined, //当前航线号
nextRouteID: undefined, //下一航线号
nextPoint: undefined, //下一航点号
distonext: undefined, //待飞距离
},
}
},
actions: {
addLayer(lName: string,dataSource?:any,imageLayer?: any,show=true) {
let time = new Date()
let layer: layer = {
dataSource: dataSource,
imageLayer: imageLayer,
lId: time.getTime().toString(),
lName: lName,
show: show
}
this.Layers.push(layer)
}
}
})