-
-
Notifications
You must be signed in to change notification settings - Fork 303
Expand file tree
/
Copy pathdemo.js
More file actions
63 lines (61 loc) · 1.47 KB
/
demo.js
File metadata and controls
63 lines (61 loc) · 1.47 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
CITIES = {
斐济: { center: [178.47489094528436, -17.82254817978705], zoom: 60 },
汤加: { zoom: 2 },
// "托克劳": {"zoom": 10},
马尔代夫: { zoom: 30 },
基里巴斯: { center: [-157.47485482439654, 1.963314847162593], zoom: 20 },
托克劳: { center: [-171.81596867083758, -9.149586970808087] },
"圣赫勒拿-阿森松和特里斯坦-达库尼亚": {
center: [-9.751032464163302, -22.285887285663264],
},
密克罗尼西亚联邦: { center: [151.79757687067706, 7.366466067885554] },
};
function make_map(cityname, dom_id) {
achart = echarts.init(document.getElementById(dom_id));
var option = {
title: [
{
textStyle: {
color: "#000",
fontSize: 18,
},
subtext: "",
text: cityname,
top: "auto",
subtextStyle: {
color: "#aaa",
fontSize: 12,
},
left: "auto",
},
],
legend: [
{
selectedMode: "multiple",
top: "top",
orient: "horizontal",
data: [""],
left: "center",
show: true,
},
],
backgroundColor: "#fff",
series: [],
};
series = {
mapType: cityname,
data: [],
name: "",
symbol: "circle",
type: "map",
roam: true,
};
additional = {};
console.log(cityname);
if (cityname in CITIES) {
additional = CITIES[cityname];
console.log(additional);
}
option.series.push({ ...series, ...additional });
achart.setOption(option);
}