-
Notifications
You must be signed in to change notification settings - Fork 0
/
guiji.html
77 lines (68 loc) · 2.88 KB
/
guiji.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
<!DOCTYPE html>
<html lang="en">
<head>
<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>Show tails</title>
<script type="text/javascript" src="Sandcastle/Sandcastle-header.js"></script>
<script src="jquery-3.5.1.min.js"></script>
<script type="text/javascript" src="guiji.js"></script>
<script type="text/javascript" src="Build/CesiumUnminified/Cesium.js"></script>
<script type="text/javascript" src="datePlugin.js" ></script>
</head>
<body>
<style>
@import url(Build/Cesium/Widgets/widgets.css);
@import url(Sandcastle/templates/bucket.css);
</style>
<div class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<div id="cesiumContainer", class="fullSize"></div>
<input class="cesium-button" id = "startTime" onclick="SelectDate(this,'yyyy-MM-dd hh:mm:ss')" type="button" value="start time">
<input class="cesium-button" id ="endTime" onclick="SelectDate(this,'yyyy-MM-dd hh:mm:ss')" type="button" value="end time">
<select id="selectdid" class="cesium-button">
<option value="88010E2005002F5A" selected="selected">88010E2005002F5A</option>
<option value="88010E20050044D8">88010E20050044D8</option>
</select>
<input id="refresh" type="button" value="let's go" class="cesium-button" onclick="showTrace()")>
</div>
<script id="cesium_sandcastle_script">
//1.设置container初始参数
var osm = new Cesium.OpenStreetMapImageryProvider({
url: 'https://a.tile.openstreetmap.org/'
});
var viewer = new Cesium.Viewer('cesiumContainer', {
animation: false, //不显示动画控件
homeButton: false, //不显示Home按钮
timeline: false, //不显示时间线控件
imageryProvider: osm
});
viewer.camera.setView({
destination:Cesium.Cartesian3.fromDegrees(114.35412807424511,30.53130049933386,1500.0),
})
//2.显示轨迹
function showTrace(){
//删除之前的轨迹
viewer.dataSources.removeAll();
viewer.entities.removeAll();
var startTime = $("#startTime").attr("value");
var endtime = $("#endTime").attr("value");
//获取参数
var did = selectdid.value;
let utcBegin = String((new Date(startTime)).getTime());
let utcEnd = String((new Date(endtime)).getTime());
//获取数据及显示点、线
var data = getData(did, utcBegin, utcEnd);
console.log(data);
var pA = getPointEntities(data);
for (var i=0; i<pA.length; i++){
viewer.entities.add(pA[i]);
};
var lc = getLineCzml(data);
var dataSourcePromise = Cesium.CzmlDataSource.load(lc);
viewer.dataSources.add(dataSourcePromise);
}
</script>
</body>
</html>