config.ts
2.09 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import { echartOptionProfixHandle, PublicConfigClass } from '@/packages/public'
import { AddThreeDimensionalMapConfig } from './index'
import { chartInitConfig } from '@/settings/designSetting'
import { CreateComponentType } from '@/packages/index.d'
import cloneDeep from 'lodash/cloneDeep'
import dataMaps from './data.json'
//省市区枚举
export const enum areaEnum {
PROVINCE = 'PROVINCE', //省份
CITY = 'CITY', //城市
COUNTY = 'COUNTY', //县
COUNTRY = 'COUNTRY', //国家
TOWN = 'TOWN' //镇
}
export const includes = []
export const option = {
iconColor: 'black',
showIcon: false,
iconDistanceRight: 20,
iconDistanceTop: 20,
drillingIn: false,
dataset: dataMaps,
mapRegion: {
adcode: 'china',
showHainanIsLands: true,
saveSelect: {
levelStr: areaEnum.COUNTRY
}
},
tooltip: {
show: true
},
geo3D: {
show: false, // 隐藏该层,为true时会导致出现两个地图
map: 'centerMap',
roam: true,
regionHeight: 0,
emphasis: {
label: {
show: true,
textStyle: {
color: '#000',
fontSize: 14
}
},
itemStyle: {
color: '#ff0'
}
}
},
series: [
{
type: 'map3D',
map: 'centerMap',
name: 'centerMap',
regionHeight: 3,
label: {
show: true,
textStyle: {
color: '#fff',
fontSize: 14
}
},
itemStyle: {
color: 'green',
borderWidth: 0.8,
borderColor: 'blue'
},
data: []
},
{
name: 'scatter3D',
type: 'scatter3D',
coordinateSystem: 'geo3D',
symbol: 'circle',
symbolSize: 20,
animation: true,
data: dataMaps
}
]
}
export const MapDefaultConfig = { ...option }
export default class Config extends PublicConfigClass implements CreateComponentType {
public key: string = AddThreeDimensionalMapConfig.key
public attr = { ...chartInitConfig, w: 750, h: 800, zIndex: -1 }
public chartConfig = cloneDeep(AddThreeDimensionalMapConfig)
public option = echartOptionProfixHandle(option, includes)
}