@@ -6,8 +6,11 @@ discard block |
||
6 | 6 | //$_COOKIE['MapFormat'] = '2d'; |
7 | 7 | |
8 | 8 | // Compressed GeoJson is used if true |
9 | -if (!isset($globalJsonCompress)) $compress = true; |
|
10 | -else $compress = $globalJsonCompress; |
|
9 | +if (!isset($globalJsonCompress)) { |
|
10 | + $compress = true; |
|
11 | +} else { |
|
12 | + $compress = $globalJsonCompress; |
|
13 | +} |
|
11 | 14 | ?> |
12 | 15 | <?php |
13 | 16 | if (isset($_GET['archive'])) { |
@@ -19,8 +22,11 @@ discard block |
||
19 | 22 | //$lastupd = round(($_GET['enddate']-$_GET['begindate'])/(($_GET['during']*60)/10)); |
20 | 23 | //$lastupd = 20; |
21 | 24 | $lastupd = $_GET['archivespeed']*$archiveupdatetime; |
22 | - if (isset($_GET['enddate']) && $_GET['enddate'] != '') $enddate = $_GET['enddate']; |
|
23 | - else $enddate = time(); |
|
25 | + if (isset($_GET['enddate']) && $_GET['enddate'] != '') { |
|
26 | + $enddate = $_GET['enddate']; |
|
27 | + } else { |
|
28 | + $enddate = time(); |
|
29 | + } |
|
24 | 30 | setcookie("archive_begin",$begindate); |
25 | 31 | setcookie("archive_end",$enddate); |
26 | 32 | setcookie("archive_update",$lastupd); |
@@ -127,7 +133,17 @@ discard block |
||
127 | 133 | } |
128 | 134 | |
129 | 135 | //create the map |
130 | - map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) print $latitude; else print $globalCenterLatitude; ?>,<?php if (isset($longitude)) print $longitude; else print $globalCenterLongitude; ?>], zoom); |
|
136 | + map = L.map('archive-map', { zoomControl:false }).setView([<?php if (isset($latitude)) { |
|
137 | + print $latitude; |
|
138 | +} else { |
|
139 | + print $globalCenterLatitude; |
|
140 | +} |
|
141 | +?>,<?php if (isset($longitude)) { |
|
142 | + print $longitude; |
|
143 | +} else { |
|
144 | + print $globalCenterLongitude; |
|
145 | +} |
|
146 | +?>], zoom); |
|
131 | 147 | <?php |
132 | 148 | } else { |
133 | 149 | ?> |
@@ -140,9 +156,19 @@ discard block |
||
140 | 156 | || navigator.userAgent.match(/BlackBerry/i) |
141 | 157 | || navigator.userAgent.match(/Windows Phone/i)) |
142 | 158 | { |
143 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom-1; else print '8'; ?>; |
|
159 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
160 | + print $globalLiveZoom-1; |
|
161 | +} else { |
|
162 | + print '8'; |
|
163 | +} |
|
164 | +?>; |
|
144 | 165 | } else { |
145 | - var zoom = <?php if (isset($globalLiveZoom)) print $globalLiveZoom; else print '9'; ?>; |
|
166 | + var zoom = <?php if (isset($globalLiveZoom)) { |
|
167 | + print $globalLiveZoom; |
|
168 | +} else { |
|
169 | + print '9'; |
|
170 | +} |
|
171 | +?>; |
|
146 | 172 | } |
147 | 173 | |
148 | 174 | //create the map |
@@ -167,16 +193,27 @@ discard block |
||
167 | 193 | bounds = L.latLngBounds(southWest,northEast); |
168 | 194 | //a few title layers |
169 | 195 | <?php |
170 | - if (isset($_COOKIE['MapType'])) $MapType = $_COOKIE['MapType']; |
|
171 | - else $MapType = $globalMapProvider; |
|
196 | + if (isset($_COOKIE['MapType'])) { |
|
197 | + $MapType = $_COOKIE['MapType']; |
|
198 | + } else { |
|
199 | + $MapType = $globalMapProvider; |
|
200 | + } |
|
172 | 201 | |
173 | 202 | if ($MapType == 'Mapbox') { |
174 | - if ($_COOKIE['MapTypeId'] == 'default') $MapBoxId = $globalMapboxId; |
|
175 | - else $MapBoxId = $_COOKIE['MapTypeId']; |
|
176 | -?> |
|
203 | + if ($_COOKIE['MapTypeId'] == 'default') { |
|
204 | + $MapBoxId = $globalMapboxId; |
|
205 | + } else { |
|
206 | + $MapBoxId = $_COOKIE['MapTypeId']; |
|
207 | + } |
|
208 | + ?> |
|
177 | 209 | L.tileLayer('https://{s}.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={token}', { |
178 | 210 | maxZoom: 18, |
179 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
211 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
212 | + print 'false'; |
|
213 | +} else { |
|
214 | + print 'true'; |
|
215 | +} |
|
216 | +?>, |
|
180 | 217 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
181 | 218 | '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + |
182 | 219 | 'Imagery © <a href="http://mapbox.com">Mapbox</a>', |
@@ -188,7 +225,12 @@ discard block |
||
188 | 225 | ?> |
189 | 226 | L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
190 | 227 | maxZoom: 18, |
191 | - noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) print 'false'; else print 'true'; ?>, |
|
228 | + noWrap: <?php if (isset($globalMapWrap) && !$globalMapWrap) { |
|
229 | + print 'false'; |
|
230 | +} else { |
|
231 | + print 'true'; |
|
232 | +} |
|
233 | +?>, |
|
192 | 234 | attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + |
193 | 235 | '<a href="www.openstreetmap.org/copyright">Open Database Licence</a>' |
194 | 236 | }).addTo(map); |
@@ -234,20 +276,26 @@ discard block |
||
234 | 276 | map.addLayer(yandexLayer); |
235 | 277 | <?php |
236 | 278 | } elseif ($MapType == 'Bing-Aerial') { |
237 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
238 | -?> |
|
279 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
280 | + setcookie('MapType','OpenStreetMap'); |
|
281 | + } |
|
282 | + ?> |
|
239 | 283 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Aerial'}); |
240 | 284 | map.addLayer(bingLayer); |
241 | 285 | <?php |
242 | 286 | } elseif ($MapType == 'Bing-Hybrid') { |
243 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
244 | -?> |
|
287 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
288 | + setcookie('MapType','OpenStreetMap'); |
|
289 | + } |
|
290 | + ?> |
|
245 | 291 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'AerialWithLabels'}); |
246 | 292 | map.addLayer(bingLayer); |
247 | 293 | <?php |
248 | 294 | } elseif ($MapType == 'Bing-Road') { |
249 | - if (!isset($globalBingMapKey) || $globalBingMapKey == '') setcookie('MapType','OpenStreetMap'); |
|
250 | -?> |
|
295 | + if (!isset($globalBingMapKey) || $globalBingMapKey == '') { |
|
296 | + setcookie('MapType','OpenStreetMap'); |
|
297 | + } |
|
298 | + ?> |
|
251 | 299 | var bingLayer = new L.tileLayer.bing({bingMapsKey: '<?php print $globalBingMapKey; ?>',imagerySet: 'Road'}); |
252 | 300 | map.addLayer(bingLayer); |
253 | 301 | <?php |
@@ -295,7 +343,12 @@ discard block |
||
295 | 343 | } |
296 | 344 | } elseif ($globalBounding == 'circle') { |
297 | 345 | ?> |
298 | - var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) print $globalBoundingCircleSize; else print '70000'; ?>,{ |
|
346 | + var circle = L.circle([<?php print $globalCenterLatitude; ?>, <?php print $globalCenterLongitude; ?>],<?php if (isset($globalBoundingCircleSize)) { |
|
347 | + print $globalBoundingCircleSize; |
|
348 | +} else { |
|
349 | + print '70000'; |
|
350 | +} |
|
351 | +?>,{ |
|
299 | 352 | color: '#92C7D1', |
300 | 353 | fillColor: '#92C7D1', |
301 | 354 | fillOpacity: 0.3, |
@@ -354,8 +407,11 @@ discard block |
||
354 | 407 | |
355 | 408 | function update_airportsLayer() { |
356 | 409 | <?php |
357 | - if (isset($_COOKIE['AirportZoom'])) $getZoom = $_COOKIE['AirportZoom']; |
|
358 | - else $getZoom = '7'; |
|
410 | + if (isset($_COOKIE['AirportZoom'])) { |
|
411 | + $getZoom = $_COOKIE['AirportZoom']; |
|
412 | + } else { |
|
413 | + $getZoom = '7'; |
|
414 | + } |
|
359 | 415 | ?> |
360 | 416 | //if (map.getZoom() <= <?php print $getZoom; ?>) { |
361 | 417 | if (typeof airportsLayer != 'undefined') { |
@@ -689,9 +745,13 @@ discard block |
||
689 | 745 | if (callsign != ""){ markerLabel += callsign; } |
690 | 746 | if (departure_airport_code != "" && arrival_airport_code != "" && departure_airport_code != "NA" && arrival_airport_code != "NA"){ markerLabel += ' ( '+departure_airport_code+' - '+arrival_airport_code+' )'; } |
691 | 747 | <?php |
692 | - if (isset($_COOKIE['IconColor'])) $IconColor = $_COOKIE['IconColor']; |
|
693 | - elseif (isset($globalAircraftIconColor)) $IconColor = $globalAircraftIconColor; |
|
694 | - else $IconColor = '1a3151'; |
|
748 | + if (isset($_COOKIE['IconColor'])) { |
|
749 | + $IconColor = $_COOKIE['IconColor']; |
|
750 | + } elseif (isset($globalAircraftIconColor)) { |
|
751 | + $IconColor = $globalAircraftIconColor; |
|
752 | + } else { |
|
753 | + $IconColor = '1a3151'; |
|
754 | + } |
|
695 | 755 | if (!isset($ident) && !isset($flightaware_id)) { |
696 | 756 | ?> |
697 | 757 | info_update(feature.properties.fc); |
@@ -739,7 +799,12 @@ discard block |
||
739 | 799 | <?php |
740 | 800 | } else { |
741 | 801 | ?> |
742 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
802 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
803 | + print $archiveupdatetime*1000; |
|
804 | +} else { |
|
805 | + print $globalMapRefresh*1000+20000; |
|
806 | +} |
|
807 | +?>+feature.properties.sqt*1000); |
|
743 | 808 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
744 | 809 | <?php |
745 | 810 | } |
@@ -786,7 +851,12 @@ discard block |
||
786 | 851 | <?php |
787 | 852 | } else { |
788 | 853 | ?> |
789 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
854 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
855 | + print $archiveupdatetime*1000; |
|
856 | +} else { |
|
857 | + print $globalMapRefresh*1000+20000; |
|
858 | +} |
|
859 | +?>+feature.properties.sqt*1000); |
|
790 | 860 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
791 | 861 | <?php |
792 | 862 | } |
@@ -832,7 +902,12 @@ discard block |
||
832 | 902 | <?php |
833 | 903 | } else { |
834 | 904 | ?> |
835 | - var movingtime = Math.round(<?php if (isset($archiveupdatetime)) print $archiveupdatetime*1000; else print $globalMapRefresh*1000+20000; ?>+feature.properties.sqt*1000); |
|
905 | + var movingtime = Math.round(<?php if (isset($archiveupdatetime)) { |
|
906 | + print $archiveupdatetime*1000; |
|
907 | +} else { |
|
908 | + print $globalMapRefresh*1000+20000; |
|
909 | +} |
|
910 | +?>+feature.properties.sqt*1000); |
|
836 | 911 | return new L.Marker.movingMarker([latLng, feature.properties.nextlatlon],[movingtime],{ |
837 | 912 | <?php |
838 | 913 | } |
@@ -1173,7 +1248,12 @@ discard block |
||
1173 | 1248 | if (isset($_GET['archive'])) { |
1174 | 1249 | ?> |
1175 | 1250 | //then load it again every 30 seconds |
1176 | -// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) print ($globalMapRefresh*1000)/2; else print '15000'; ?>); |
|
1251 | +// var reload = setInterval(function(){if (noTimeout) getLiveData(0)},<?php if (isset($globalMapRefresh)) { |
|
1252 | + print ($globalMapRefresh*1000)/2; |
|
1253 | +} else { |
|
1254 | + print '15000'; |
|
1255 | +} |
|
1256 | +?>); |
|
1177 | 1257 | reloadPage = setInterval(function(){if (noTimeout) getLiveData(0)},<?php print $archiveupdatetime*1000; ?>); |
1178 | 1258 | <?php |
1179 | 1259 | } else { |
@@ -1184,7 +1264,12 @@ discard block |
||
1184 | 1264 | if (noTimeout) { |
1185 | 1265 | getLiveData(0); |
1186 | 1266 | } |
1187 | - ,<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000; else print '30000'; ?>); |
|
1267 | + ,<?php if (isset($globalMapRefresh)) { |
|
1268 | + print $globalMapRefresh*1000; |
|
1269 | +} else { |
|
1270 | + print '30000'; |
|
1271 | +} |
|
1272 | +?>); |
|
1188 | 1273 | var currentdate = new Date(Date.UTC()); |
1189 | 1274 | var currentyear = new Date().getFullYear(); |
1190 | 1275 | var begindate = new Date(Date.UTC(currentyear,12,24,2,0,0,0)); |
@@ -1196,7 +1281,12 @@ discard block |
||
1196 | 1281 | if (!((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM) || (isset($globalphpVMS) && $globalphpVMS)) && (isset($_COOKIE['polar']) && $_COOKIE['polar'] == 'true')) { |
1197 | 1282 | ?> |
1198 | 1283 | update_polarLayer(); |
1199 | -setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1284 | +setInterval(function(){map.removeLayer(polarLayer);update_polarLayer()},<?php if (isset($globalMapRefresh)) { |
|
1285 | + print $globalMapRefresh*1000*2; |
|
1286 | +} else { |
|
1287 | + print '60000'; |
|
1288 | +} |
|
1289 | +?>); |
|
1200 | 1290 | <?php |
1201 | 1291 | } |
1202 | 1292 | ?> |
@@ -1212,7 +1302,12 @@ discard block |
||
1212 | 1302 | if ((isset($globalIVAO) && $globalIVAO) || (isset($globalVATSIM) && $globalVATSIM)) { |
1213 | 1303 | ?> |
1214 | 1304 | update_atcLayer(); |
1215 | -setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) print $globalMapRefresh*1000*2; else print '60000'; ?>); |
|
1305 | +setInterval(function(){map.removeLayer(atcLayer);update_atcLayer()},<?php if (isset($globalMapRefresh)) { |
|
1306 | + print $globalMapRefresh*1000*2; |
|
1307 | +} else { |
|
1308 | + print '60000'; |
|
1309 | +} |
|
1310 | +?>); |
|
1216 | 1311 | <?php |
1217 | 1312 | } |
1218 | 1313 | ?> |