forked from dataarts/webgl-globe
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
112 lines (91 loc) · 2.46 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
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
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>WebGL Globe</title>
<meta charset="utf-8">
<style type="text/css">
html {
height: 100%;
}
body {
margin: 0;
padding: 0;
background: #000000 url(/images/loading.gif) center center no-repeat;
color: #ffffff;
font-family: sans-serif;
font-size: 13px;
line-height: 20px;
height: 100%;
}
#info {
font-size: 11px;
position: absolute;
bottom: 5px;
background-color: rgba(0,0,0,0.8);
border-radius: 3px;
right: 10px;
padding: 10px;
}
a {
color: #aaa;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
#title {
position: absolute;
top: 20px;
width: 270px;
left: 20px;
background-color: rgba(0,0,0,0.2);
border-radius: 3px;
font: 20px Georgia;
padding: 10px;
}
#pause-button {
position: absolute;
bottom: 5px;
left: 10px;
padding: 10px;
cursor: pointer;
}
</style>
</head>
<body>
<div id="container"></div>
<div id="info">
<strong><a href="https://github.com/roback/webgl-globe">github.com/roback/webgl-globe</a></strong>
</div>
<div id="title">
Realtime Webgl Globe
</div>
<button id="pause-button">Pause</button>
<script type="text/javascript" src="/js/third-party/Detector.js"></script>
<script type="text/javascript" src="/js/third-party/three.min.js"></script>
<script type="text/javascript" src="/js/third-party/tween.min.js"></script>
<script type="text/javascript" src="/js/globe.js"></script>
<script type="text/javascript">
if(!Detector.webgl){
Detector.addGetWebGLMessage();
} else {
var container = document.getElementById('container');
var globe = new Globe(container);
var paused = false;
console.log(globe);
setInterval(function() {
if (paused) return;
var lat = Math.random() * 180 - 90;
var lng = Math.random() * 360 - 180;
globe.updatePoint(lat, lng, {amount: Math.random()*180+1});
}, 100);
globe.start();
//document.body.style.backgroundImage = 'none'; // remove loading
document.getElementById("pause-button").onclick = function() {
paused = !paused;
globe.togglePause();
};
}
</script>
</body>
</html>