-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
185 lines (164 loc) · 8.84 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<title>Predicts</title>
<link href="./assets/images/icons/balloon.png" rel="shortcut icon" type="image/png">
<link crossorigin="" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" rel="stylesheet"/>
<script crossorigin=""
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script crossorigin="anonymous" integrity="sha384-sKs8ZrrxyJoElcPVznZwGpUTTXvkMYfHYxdIFzO8Hd0TA6emONMj8BwnsFf+6cZ/"
src="https://unpkg.com/leaflet-ajax@2.1.0/dist/leaflet.ajax.min.js"></script>
<script crossorigin="anonymous" integrity="sha384-MBqvFhoifV/e9S1Ca7DFfXtEHZAYgSiDw5ek8a6BcgVfQdctO9SKp6ueQGC3PSiO"
src="https://unpkg.com/leaflet-providers@1.8.0/leaflet-providers.js"></script>
<script crossorigin=""
integrity="sha512-ciMHuVIB6ijbjTyEdmy1lfLtBwt0tEHZGhKVXDzW7v7hXOe+Fo3UA1zfydjCLZ0/vLacHkwSARXB5DmtNaoL/g==" src="https://unpkg.com/esri-leaflet@3.0.7/dist/esri-leaflet.js"></script>
<script crossorigin=""
integrity="sha512-SnA/TobYvMdLwGPv48bsO+9ROk7kqKu/tI9TelKQsDe+KZL0TUUWml56TZIMGcpHcVctpaU6Mz4bvboUQDuU3w==" src="https://unpkg.com/esri-leaflet-vector@3.1.2/dist/esri-leaflet-vector.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<link href="./assets/scripts/leaflet-groupedlayercontrol/dist/leaflet.groupedlayercontrol.min.css" rel="stylesheet"/>
<script src="./assets/scripts/leaflet-groupedlayercontrol/dist/leaflet.groupedlayercontrol.min.js"></script>
<script src="./assets/scripts/tokml/tokml.js"></script>
<script src="./assets/scripts/ajax.js"></script>
<link href="./assets/map.css" rel="stylesheet">
</head>
<body>
<section style="display: flex; justify-content: space-between;">
<div class="controls">
<div class="box labeled_input">
<label for="predict_type">Predict Type: </label>
<select name="predict_type" id="predict_type">
<option value="standard">Standard</option>
<option value="float">Float</option>
<option value="experimental_float">Experimental Float</option>
</select>
</div>
<div class="box labeled_input">
<input id="launch_date" onchange="updatePredictLayers(); copyDateToFloatEnd()" required="required" title="launch date" type="date">
<input id="launch_time" onchange="updatePredictLayers()" required="required" title="launch time" type="time" value="10:00">
</div>
<div class="box labeled_input">
<label for="ascent_rate">Ascent Rate (m/s): </label>
<input id="ascent_rate" onchange="updatePredictLayers()" required="required" style="width: 6ch;" title="expected average ascent rate"
type="number" value="5.5">
</div>
<div id="standard_controls" style="display: contents;">
<div class="box labeled_input">
<label for="burst_altitude">Burst Altitude (m): </label>
<input id="burst_altitude" onchange="updatePredictLayers()" required="required" style="width: 8ch;" title="expected burst altitude"
type="number" value="28000">
</div>
<div class="box labeled_input">
<label for="sea_level_descent_rate">S.L. Descent Rate (m/s): </label>
<input id="sea_level_descent_rate" onchange="updatePredictLayers()" required="required" style="width: 6ch;"
title="expected descent rate (at sea level)" type="number" value="9">
</div>
</div>
<div id="float_controls" style="display: contents;">
<div class="box labeled_input">
<label for="float_altitude">Float Altitude (m): </label>
<input id="float_altitude" onchange="updatePredictLayers()" required="required" style="width: 8ch;" title="float altitude" type="number" value="22000">
</div>
<div class="box labeled_input">
<label for="float_end_datetime">Float End Time: </label>
<input id="float_end_date" onchange="updatePredictLayers()" required="required" title="launch date" type="date">
<input id="float_end_time" onchange="updatePredictLayers()" required="required" title="float end time" type="time" value="10:00">
</div>
</div>
<div id="experimental_float_controls" style="display: contents;">
<div class="box labeled_input">
<label for="float_altitude">Float Altitude (m): </label>
<input id="float_altitude" onchange="updatePredictLayers()" required="required" style="width: 8ch;" title="float altitude" type="number" value="22000">
</div>
<div class="box labeled_input">
<label for="float_ascent_rate">Float Ascent Rate (m/s): </label>
<input id="float_ascent_rate" onchange="updatePredictLayers()" required="required" style="width: 8ch;" title="float altitude" type="number" value="1">
</div>
<div class="box labeled_input">
<label for="float_duration">Float Duration (mins): </label>
<input id="float_duration" onchange="updatePredictLayers()" required="required" style="width: 8ch;" title="float altitude" type="number" value="60">
</div>
<div class="box labeled_input">
<label for="sea_level_descent_rate">S.L. Descent Rate (m/s): </label>
<input id="sea_level_descent_rate" onchange="updatePredictLayers()" required="required" style="width: 6ch;"
title="expected descent rate (at sea level)" type="number" value="9">
</div>
</div>
<button id="fetch_button" onclick="updatePredictLayers()" style="font-weight: bold;">
Fetch Predicts
</button>
</div>
<script>
$(document).ready(function(){
$("#standard_controls").show();
$("#float_controls").hide();
$("#experimental_float_controls").hide();
$('#predict_type').on('change', function() {
if ( this.value == 'standard')
{
$("#standard_controls").show();
$("#float_controls").hide();
$("#experimental_float_controls").hide();
}
else if ( this.value == 'float')
{
$("#standard_controls").hide();
$("#float_controls").show();
$("#experimental_float_controls").hide();
}
else if ( this.value == 'experimental_float')
{
$("#standard_controls").hide();
$("#float_controls").hide();
$("#experimental_float_controls").show();
}
});
});
</script>
</section>
<section id="map">
<script src="./assets/scripts/functions.js"></script>
<script src="./assets/scripts/layers.js"></script>
<script async src="./predicts.js"></script>
<script async>
MAP.setView([39.4, -77.4], 10);
MAP.addLayer(CONTROLLED_AIRSPACE_LAYER);
</script>
<script async>
let today = new Date();
let next_saturday = new Date();
next_saturday.setDate(today.getDate() + (7 + 6 - today.getDay()) % 7);
let prediction_end = new Date();
prediction_end.setDate(today.getDate() + 7);
let date_input = document.getElementById('launch_date');
date_input.value = next_saturday.toISOString().split('T')[0];
date_input.min = today.toISOString().split('T')[0];
date_input.max = prediction_end.toISOString().split('T')[0];
date_input = document.getElementById('float_end_date');
date_input.value = next_saturday.toISOString().split('T')[0];
date_input.min = today.toISOString().split('T')[0];
date_input.max = prediction_end.toISOString().split('T')[0];
</script>
<script async type="text/javascript">
window.onload = function () {
MAP.on('contextmenu', setCustomLaunchLocation);
updatePredictLayers({resize: true});
};
</script>
</section>
<section>
<div class="controls">
<button id="reset_zoom" onclick="resizeToOverlayLayers()">Zoom To Predicts</button>
<a class="box" href="#" onClick="document.location.href=downloadPredictsKML();">
Download Predicts
</a>
<a class="box" href="#"
onClick="document.location.href=downloadURI('./assets/data/controlled_airspace.kmz', 'CONTROLLED_AIRSPACE_LAYER.kmz');">
Download Airspace
</a>
</div>
</section>
</body>
</html>