-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
76 lines (73 loc) · 2.73 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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Use correct character set. -->
<meta charset="utf-8">
<!-- Tell IE to use the latest, best version (or Chrome Frame if pre-IE11). -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<!-- Make the application on mobile take up the full browser screen and disable user scaling. -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>Lucene GeoView</title>
<script src="../Build/Cesium/Cesium.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<style>
@import url(../Build/Cesium/Widgets/widgets.css);
html, body, #cesiumContainer {
width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden;
}
</style>
</head>
<body>
<div id="cesiumContainer"></div>
<script>
var terrain = new Cesium.CesiumTerrainProvider({
url : '//assets.agi.com/stk-terrain/world',
requestVertexNormals: true,
requestWaterMask: true
});
// var viewer = new Cesium.Viewer('cesiumContainer', {
// baseLayerPicker: false,
// imageryProvider: new Cesium.OpenStreetMapImageryProvider({
// url : 'http://a.tile.openstreetmap.org'
// })
// });
var viewer = new Cesium.Viewer('cesiumContainer', {
baseLayerPicker: false,
imageryProvider: new Cesium.BingMapsImageryProvider({
url : 'http://dev.virtualearth.net',
key : 'An7DMALLDX3IzQyY-3wbSa0MaUIXIuAg-buSeTaOrbfLeD7diqOyXUavb275X37W'
})
});
viewer.terrainProvider = terrain;
viewer.scene.globe.enableLighting = true;
longPoll_feed();
function longPoll_feed() {
console.log("longPoll called");
// make another request
$.ajax({
cache: false,
dataType: 'json',
type: "GET",
url: "/real_time_feed",
error: function() {
// don't flood the servers on error
setTimeout(longPoll_feed, 10*1000);
},
success: function (json) {
var j = JSON.stringify(json);
j = j.substring(1, j.length-1);
json = JSON.parse(j);
console.log("adding to map " + json);
viewer.dataSources.add(Cesium.GeoJsonDataSource.load(json, {
stroke: Cesium.Color.HOTPINK,
fill: Cesium.Color.PINK.withAlpha(0.5),
strokeWidth: 3
}));
// L.geoJson(json).addTo(map);
longPoll_feed();
}
});
}
</script>
</body>
</html>