-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
31 lines (28 loc) · 979 Bytes
/
main.js
File metadata and controls
31 lines (28 loc) · 979 Bytes
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
const WorldWindowWrapper = require('./setupWorldView');
const {fetchSats, fetchSatelliteCoordinates} = require('./fetch.js')
function subscribeHandlers(wwObj) {
$('#timeSlider').on('change', () => {
wwObj.timePercent = $('#timeSlider').val();
wwObj.replaceSatellites();
})
$('#datePicker').on('change', () => {
let date = $('#datePicker').val()
let startTime = date + 'T00:00:00+5:00';
let endTime = date + 'T11:59:59+5:00';
fetchSatelliteCoordinates(wwObj, startTime, endTime);
})
}
function main() {
let wwd = new WorldWind.WorldWindow("canvasOne");
worldWindow = new WorldWindowWrapper(wwd);
worldWindow.setupWorldView();
fetchSats().then(
(res) => {
worldWindow.satelliteIds = res;
fetchSatelliteCoordinates(
worldWindow, '2017-10-20T15:53:00+05:00', '2018-10-20T15:53:00+05:00');
}
);
subscribeHandlers(worldWindow);
}
$(main);