-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpreview.html
113 lines (102 loc) · 3.16 KB
/
preview.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
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Preview of orbits.lib.js</title>
<style>
html, body {
border: 0;
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="map" style="width: 100%; height: 100%"></div>
<script src="http://maps.google.com/maps/api/js?v=3.10&libraries=geometry&sensor=false&language=en_us&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="orbits.js" type="text/javascript"></script>
<script type="text/javascript">
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 2,
center: new google.maps.LatLng(0,0),
mapTypeId: google.maps.MapTypeId.ROADMAP,
keyboardShortcuts: false,
streetViewControl: false,
rotateControl: false,
panControl: false,
scaleControl: false,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.DEFAULT
},
scrollwheel: true
});
var stations;
var sats = [];
$.get("stations.txt", function(data) {
stations = orbits.util.parseTLE(data);
//console.log(stations);
var i = 0;
for(;i < stations.length; i++) {
var name = stations[i].name;
var satOpts = {
map: map,
tle: stations[i],
pathLength: 2,
};
if(name == "ISS (ZARYA)") {
satOpts.markerOpts = {
icon: {
url: "img/iss.png",
size: new google.maps.Size(65,50),
scaledSize: new google.maps.Size(65,50),
anchor: new google.maps.Point(30,30),
},
};
satOpts.polylineOpts = {
strokeWeight: 2,
strokeColor: "blue",
strokeOpacity: 0.6
};
}
else if(name == "TIANGONG 1") {
satOpts.markerOpts = {
icon: {
url: "img/TIANGONG1.png",
size: new google.maps.Size(70,40),
scaledSize: new google.maps.Size(70,40),
anchor: new google.maps.Point(25,10),
},
};
satOpts.polylineOpts = {
strokeWeight: 2,
strokeColor: "#c700e6",
strokeOpacity: 0.6
};
satOpts.shadowPolylinesOpts = {
strokeColor: "#c700e6",
}
}
else {
continue;
}
var sat = new orbits.Satellite(satOpts);
sat.refresh()
sat.refresh_path();
sats.push(sat);
}
setInterval(function() {
var i = 0;
for(;i < sats.length; i++) sats[i].refresh();
}, 500);
setInterval(function() {
var i = 0;
for(;i < sats.length; i++) sats[i].refresh_path();
}, 5*60000);
});
</script>
</body>
</html>