-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathminimal.html
90 lines (74 loc) · 2.39 KB
/
minimal.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
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>gpredict.js - Example</title>
<link href="phonesat.css" rel="stylesheet" type="text/css"/>
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css"/>
<!-- leafletjs for map display -->
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
</head>
<body>
<div id="map"></div>
</body>
</html>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script type="text/javascript" src="../dist/gpredict.min.js"></script>
<script type="text/javascript" src="minimal.js"></script>
<script type="text/javascript">
// Create the map
var map = L.map(
'map',
{
center: [0, 0],
zoom: 2,
maxBounds: [[-90, -180], [90, 180]],
minZoom: 2,
zoomControl: false
}
);
// Add openstreetmap layer
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 18,
attribution: 'Map data © OpenStreetMap contributors'
}).addTo(map);
// Add a scale
L.control.scale({maxWidth: 500}).addTo(map);
// Add layer control button
var layers_control = L.control.layers();
layers_control.addTo(map);
// Init satellites
var sats = [];
// Default ground station
qth = new qth_t();
qth.lat=0;
qth.lon=0;
qth.alt=0;
// Number of positions to compute
var COUNT = 300;
// Interval in ms between positions to compute
var STEP = 60*1000;
var SATELLITES = [{id: 25544,
freq: 437.1,
tle: ['ISS',
'1 25544U 98067A 18300.24318025 .00001410 00000-0 28792-4 0 9995',
'2 25544 51.6403 80.6450 0004088 342.1993 74.5258 15.53867767139059']},
{id: 28628,
tle: ['INMARSAT 4-F1',
'1 28628U 05009A 18299.55629977 -.00000257 00000-0 00000+0 0 9993',
'2 28628 2.9417 19.0021 0003300 209.0333 150.6619 1.00271647 49694']}];
SATELLITES.forEach(function(satellite, index, array) {
// Construct a new satellite
var sat = new Sat_t();
// Load its orbit data from TLE
gtk_sat_data_read_sat(satellite.tle, sat);
// Set its color
sat.color = 'rgb(255,0,0)';
sat.mapInit(map);
// Save it to the list
sats.push(sat);
});
// Start timer
window.setInterval("refresh()", 1000);
</script>