-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.html
64 lines (62 loc) · 1.53 KB
/
map.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/echarts/4.2.0-rc.2/echarts.min.js"></script>
</head>
<body >
<div id="main" style="width: 505px;height: 530px;"></div>
<script>
const myChart = echarts.init(document.getElementById('main'))
myChart.showLoading();
$.get('node_modules/echarts/map/json/province/gansu.json').done(function (geoJson) {
myChart.hideLoading();
echarts.registerMap('云南', geoJson);
myChart.setOption( {
visualMap: {
min: 0,
max: 500,
show: false,
splitNumber: 5,
inRange: {
color: ['#d94e5d', '#eac736', '#50a3ba'].reverse()
},
textStyle: {
color: '#fff'
}
},
geo: {
map: '云南',
label: {
normal: {
show: true,
color: '#fff'
},
emphasis: {
show: true,
color: '#fff'
}
},
roam: false,
itemStyle: {
normal: {
areaColor: '#40458e',
borderColor: '#6367ad',
borderWidth: 1.5
},
emphasis: {
areaColor: '#40458e'
}
},
"left": 0,
"right": 0,
"top": 0,
"bottom": 0
},
});
});
</script>
</body>
</html>