1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| import { defineStore } from 'pinia'
| import { store } from '@/store'
| import { FeatureCollection } from '@antv/l7plot/dist/esm/plots/choropleth/types'
| interface MapStore {
| mapCache: Record<string, FeatureCollection>
| mapKey: {
| key: string
| securityCode: string
| mapType: string
| }
| }
| export const useMapStore = defineStore('map', {
| state: (): MapStore => ({
| mapCache: {},
| mapKey: {
| key: '',
| securityCode: '',
| mapType: ''
| }
| }),
| actions: {
| setMap({ id, geoJson }) {
| this.mapCache[id] = geoJson
| },
| setKey(key) {
| this.mapKey = key
| }
| }
| })
|
| export const useMapStoreWithOut = () => useMapStore(store)
|
|