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

30 lines
702 B
TypeScript

import {defineStore} from "pinia";
type layer = {
lName: string
lId: string
dataSource?: any
imageLayer?: any
show: boolean
}
export const useLayerStore = defineStore('LayerStore', {
state: ()=>{
return {
Layers: [] as layer[]
}
},
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)
}
}
})