-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
85 lines (77 loc) · 2.24 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Heatmap3D热力图</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.jpg" />
<link rel="stylesheet" href="../../../cesium/libs/Cesium-1.98/Build/Cesium/Widgets/widgets.css">
<script type="text/javascript" src="../../../cesium/libs/Cesium-1.98/Build/Cesium/Cesium.js"></script>
<script src="HeatMap3D.js"></script>
<style>
html,
body,
#cesiumContainer {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
</body>
<script>
const opts = {};
const args = [
"geocoder",
"homeButton",
"sceneModePicker",
"baseLayerPicker",
"navigationHelpButton",
"animation",
"shouldAnimate",
"timeline",
"fullscreenButton",
"vrButton",
"infoBox",
"selectionIndicator",
];
for (let i = 0; i < args.length; i++) {
if (!opts[args[i]]) {
opts[args[i]] = false;
}
}
opts.creditContainer = document.createElement("div");
const viewer = new Cesium.Viewer('cesiumContainer', {
...opts,
//这句很重要
contextOptions: {
requestWebgl2: true,
msaa: true,
multisampleNum: 8,
}
});
viewer.camera.flyTo({
destination: new Cesium.Cartesian3(-2781022.238205981, 4831350.90118472, 3178397.0879110717),
orientation: {
heading: 0.09545131503544901,
pitch: -0.7670453352947222,
roll: 0.00038362839268746285
}
});
const heatMap = new HeatMap3D(viewer);
let url = 'random.json';
url = 'normal.json';
fetch(url).then(res=>res.json()).then(data=>{
console.log(data);
heatMap.loadGeoJsonData(data);
})
setTimeout(() => {
heatMap.remove();
}, 3*60*1000);
// heatMap.loadGeoJsonData(url);
</script>
</html>