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.
30 lines
702 B
TypeScript
30 lines
702 B
TypeScript
3 months ago
|
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)
|
||
|
}
|
||
|
}
|
||
|
})
|