-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCesiumHeatmap2.html
72 lines (69 loc) · 2.06 KB
/
CesiumHeatmap2.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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<title>Cesium热力图2</title>
<script src="Cesium/Cesium.js"></script>
<link href="Cesium/Widgets/widgets.css" rel="stylesheet" />
<script src="plugin/heatmap/heatmap.min.js"></script>
<script src="plugin/heatmap/webgl-heatmap.js"></script>
<script src="plugin/heatmap/CesiumHeatmapGL.js"></script>
<style>
html,
body,
#cesiumContainer {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#menu {
position: absolute;
top: 80px;
left: 10px;
z-index: 999;
}
</style>
</head>
<body>
<div id="menu">
<p>
<button onclick="Draw()">绘制</button>
</p>
</div>
<div id="cesiumContainer" class="fullSize"></div>
<div id="creditContainer" style="display: none"></div>
<span style="white-space: pre"></span>
<script>
/*
参考 https://github.com/wangzhongliang/CesiumHeatmap wangzhongliang/CesiumHeatmap
*/
//一: ArcGisMapServerImageryProvider
var esri = new Cesium.ArcGisMapServerImageryProvider({
url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer',
enablePickFeatures: false,
})
var viewer = new Cesium.Viewer('cesiumContainer', {
imageryProvider: esri,
selectionIndicator: false,
animation: false,
baseLayerPicker: false,
geocoder: false,
timeline: false,
sceneModePicker: true,
navigationHelpButton: false,
infoBox: false,
fullscreenButton: true,
})
var heatmap = null
function Draw() {
if (heatmap == null) {
heatmap = new CesiumHeatmapGL(viewer, 'plugin/heatmap/busstop2016.geojson')
}
}
</script>
</body>
</html>