-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
91 lines (88 loc) · 3.06 KB
/
index.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
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
<html>
<head>
<meta charset="UTF-8" />
<style>
* {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="chart"></div>
<script src="./assets/jquery.js"></script>
<script src="./assets/echarts-all.js"></script>
<script src="./assets/echarts-gl.min.js"></script>
<script>
const geoJsonList = [];
function renderChartImpl() {
const chart = document.getElementById("chart");
geoJsonList.map(function(json, idx) {
echarts.registerMap("map" + idx, json);
});
var chartsConfig = {
background: '#ff00ff',
title: {
show: false,
},
toolbox: {
show: false
},
series: geoJsonList.map(function(obj, idx) {
return {
name: 'map' + idx,
type: 'map3D',
map: 'map' + idx,
roam: true,
itemStyle: {
areaColor: '#1d5e98',
opacity: 1,
borderWidth: 0.4,
borderColor: '#000'
},
label: {
show: false,
textStyle: {
color: '#000', //地图初始化区域字体颜色
fontSize: 8,
opacity: 1,
backgroundColor: 'rgba(0,23,11,0)'
},
},
//shading: 'lambert',
light: { //光照阴影
main: {
color: '#fff', //光照颜色
intensity: 1.2, //光照强度
//shadowQuality: 'high', //阴影亮度
shadow: false, //是否显示阴影
alpha:55,
beta:10
},
ambient: {
intensity: 0.3
}
}
};
})
};
var ecIns = echarts.init(chart);
ecIns.setOption(chartsConfig);
}
function renderChart(params) {
const geoJson = params.geoJson;
const chart = document.getElementById("chart");
chart.style.width = params.width + 'px';
chart.style.height = params.height + 'px';
geoJson.map(function(jsonFile, idx) {
$.get('json/' + jsonFile, function(json) {
geoJsonList[idx] = json;
});
});
setTimeout(function() {
renderChartImpl()
}, 1000);
}
</script>
</body>
</html>