-
Notifications
You must be signed in to change notification settings - Fork 0
/
荧光大数据.html
170 lines (155 loc) · 5.82 KB
/
荧光大数据.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta charset="utf-8">
<style>
.echartMap div {
position: absolute;
overflow: auto;
}
</style>
</head>
<body style="height: 100%; margin: 0">
<div id="container" style="height: 100%"></div>
<script type="text/javascript" src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script type="text/javascript" src="lib/echarts-all-3.js"></script>
<script src='lib/mapbox-gl-dev.js'></script>
<link href='lib/mapbox-gl.css' rel='stylesheet' />
<script type="text/javascript" src="js/EchartsLayer.js"></script>
<script type="text/javascript">
$.get('./data/weibo.json', function (data) {
let weiboData = $.parseJSON(data);
weiboData = weiboData.map(function (serieData, idx) {
var px = serieData[0] / 1000;
var py = serieData[1] / 1000;
var res = [
[px, py]
];
for (var i = 2; i < serieData.length; i += 2) {
var dx = serieData[i] / 1000;
var dy = serieData[i + 1] / 1000;
var x = px + dx;
var y = py + dy;
res.push([x.toFixed(2), y.toFixed(2), 1]);
px = x;
py = y;
}
return res;
});
var map = new mapboxgl.Map({
container: 'container', // container id
style: {
'version': 8,
'sources': {},
'layers': []
},
center: [112, 37.94], // starting position
// hash: true,
// interactive:false,
// pitch: 45,
zoom: 3 // starting zoom
})
map.addControl(new mapboxgl.NavigationControl())
map.on('load', function () {
map.addSource('google.tile', {
'type': 'raster',
'tiles': ['https://www.google.cn/maps/vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}'],
'tileSize': 256
})
map.addLayer({
'id': 'google',
'type': 'raster',
'source': 'google.tile'
})
var echartslayer=new EchartsLayer(map);
echartslayer.chart.setOption(option = {
GLMap: {
roam: true
},
coordinateSystem: 'GLMap',
title: {
text: '微博签到数据点亮中国',
subtext: 'From ThinkGIS',
sublink: 'http://www.thinkgis.cn/public/sina',
left: 'center',
top: 'top',
textStyle: {
color: '#fff'
}
},
tooltip: {},
legend: {
left: 'left',
data: ['强', '中', '弱'],
textStyle: {
color: '#ccc'
}
},
geo: {
name: '强',
type: 'scatter',
map: 'GLMap',
label: {
emphasis: {
show: false
}
},
itemStyle: {
normal: {
areaColor: '#323c48',
borderColor: '#111'
},
emphasis: {
areaColor: '#2a333d'
}
}
},
series: [{
name: '弱',
type: 'scatter',
coordinateSystem: 'GLMap',
symbolSize: 1,
large: true,
itemStyle: {
normal: {
shadowBlur: 2,
shadowColor: 'rgba(37, 140, 249, 0.8)',
color: 'rgba(37, 140, 249, 0.8)'
}
},
data: weiboData[0]
}, {
name: '中',
type: 'scatter',
coordinateSystem: 'GLMap',
symbolSize: 1,
large: true,
itemStyle: {
normal: {
shadowBlur: 2,
shadowColor: 'rgba(14, 241, 242, 0.8)',
color: 'rgba(14, 241, 242, 0.8)'
}
},
data: weiboData[1]
}, {
name: '强',
type: 'scatter',
coordinateSystem: 'GLMap',
symbolSize: 1,
large: true,
itemStyle: {
normal: {
shadowBlur: 2,
shadowColor: 'rgba(255, 255, 255, 0.8)',
color: 'rgba(255, 255, 255, 0.8)'
}
},
data: weiboData[2]
}]
});
})
});
</script>
</body>
</html>