Skip to content

Commit 3821bf0

Browse files
author
xss
committed
various fixes
1 parent 88fd4a0 commit 3821bf0

File tree

2 files changed

+58
-45
lines changed

2 files changed

+58
-45
lines changed

index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<div class="bar" style="display: none"><div class="complete"></div></div>
3232
</div>
3333
</div>
34-
3534
<header style="display: none">
3635
<div class="container">
3736
<div class="search">
@@ -364,6 +363,11 @@ <h3>Report Recovery</h3>
364363
</div>
365364
<div id="homebox" style="width:0px;height:0px"></div>
366365
<div id="mapscreen">
366+
<div style="width: 100%;">
367+
<div id="zoom_warning" class="lfloat slickbox" style="width:250px; top: 30px; left: 50%; transform: translate(-50%, -50%);">
368+
<div style="width:250px">Zoom in for realtime data!</div>
369+
</div>
370+
</div>
367371
<div id="timebox" class="present slickbox animate" style="display: none">
368372
<svg width="40" height="40" viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" version="1.1" version="1.1" class="lfloat">
369373
<path d="M99.812,43.188c-2.77,0-5,2.032-5,4.562v40.875c-4.315,1.97-7.312,6.321-7.312,11.375,0,6.9,5.596,12.5,12.5,12.5,1.05,0,2.06-0.16,3.03-0.41l23.35,23.35c2.23,2.24,5.93,2.13,8.28-0.22s2.42-6.04,0.18-8.28l-23-23c0.42-1.24,0.66-2.56,0.66-3.94,0-5.202-3.17-9.68-7.69-11.562v-40.688c0-2.53-2.23-4.562-4.998-4.562zm-5.906-23c0.031-0.003,0.063,0.002,0.094,0v14.374c0,0.236,0.202,0.438,0.438,0.438h11.122c0.24,0,0.44-0.202,0.44-0.438v-14.343c39.4,2.921,70.86,34.381,73.78,73.781h-14.34c-0.24,0-0.44,0.171-0.44,0.406v11.154c0,0.24,0.2,0.44,0.44,0.44h14.34c-2.92,39.4-34.38,70.86-73.78,73.78v-14.37c0-0.24-0.2-0.41-0.44-0.41h-11.122c-0.236,0-0.438,0.17-0.438,0.41v14.37c-39.4-2.92-70.86-34.38-73.781-73.78h14.343c0.236,0,0.438-0.2,0.438-0.44v-11.154c0-0.235-0.202-0.406-0.438-0.406h-14.343c2.918-39.372,34.33-70.848,73.687-73.812zm6.094-10.188c-49.706,0-90,40.294-90,90,0,49.71,40.294,90,90,90,49.71,0,90-40.29,90-90,0-49.706-40.29-90-90-90zm0-10c55.23,0,100,44.772,100,100,0,55.23-44.77,100-100,100-55.228,0-100-44.77-100-100,0-55.228,44.772-100,100-100z"></path>

js/tracker.js

Lines changed: 53 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -714,15 +714,17 @@ function throttle_events(event) {
714714

715715
function sub_to_nearby_sondes(){
716716
let bounds = map.getBounds().pad(1); // expand by one viewport
717-
let zoomed_out = map.getZoom() <= 7;
717+
let zoomed_out = map.getZoom() <= 6;
718718
if (zoomed_out){
719719
// If we are fairly zooomed out - only give the slow feed
720720
for(let i = 1; i<clientTopic.length; i++){ // skip first slow topic
721721
console.log("zoomed fully out. unsubbing from " + clientTopic[i])
722722
client.unsubscribe(clientTopic[i]);
723723
}
724724
clientTopic = [clientTopic[0]]
725+
document.getElementById("zoom_warning").style.display="block"
725726
} else {
727+
document.getElementById("zoom_warning").style.display="none"
726728
// If zoomed in then we sub to specific sondes
727729
for (let vehicle in vehicles){
728730
let topic = "sondes/"+vehicle;
@@ -822,6 +824,7 @@ function clean_refresh(text, force, history_step) {
822824
refreshNewReceivers(true);
823825
}
824826

827+
sub_to_nearby_sondes();
825828
return true;
826829
}
827830

@@ -1633,7 +1636,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
16331636
zIndexOffset: Z_CAR,
16341637
icon: landing_icon,
16351638
title: vcallsign + " Onboard Landing Prediction",
1636-
}).addTo(map);
1639+
})//.addTo(map);
16371640

16381641
// Add the marker to the vehicle object.
16391642
vehicle.landing_marker = landing_marker;
@@ -1826,9 +1829,9 @@ function updateVehicleInfo(vcallsign, newPosition) {
18261829
'<i class="arrow"></i></div>' +
18271830
'<div class="data">' +
18281831
'<img class="'+((vehicle.vehicle_type=="car")?'car':'')+'" src="'+image+'" />' +
1829-
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:'+(vehicle.image_src_size[1]+85)+'px">Share</span>' : '') +
1830-
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="skewTdraw(\'' + vcallsign + '\')" style="top:'+(vehicle.image_src_size[1]+115)+'px">SkewT</span>' : '') +
1831-
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="openURL(\'' + grafana_dashboard_url + '\')" style="top:'+(vehicle.image_src_size[1]+145)+'px">Plots</span>' : '') +
1832+
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:'+(vehicle.image_src_size[1]+55)+'px">Share</span>' : '') +
1833+
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="skewTdraw(\'' + vcallsign + '\')" style="top:'+(vehicle.image_src_size[1]+85)+'px">SkewT</span>' : '') +
1834+
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="openURL(\'' + grafana_dashboard_url + '\')" style="top:'+(vehicle.image_src_size[1]+115)+'px">Plots</span>' : '') +
18321835
'<div class="left">' +
18331836
'<dl>';
18341837
//mobile
@@ -1838,9 +1841,9 @@ function updateVehicleInfo(vcallsign, newPosition) {
18381841
'<i class="arrow"></i></div>' +
18391842
'<div class="data">' +
18401843
'<img class="'+((vehicle.vehicle_type=="car")?'car':'')+'" src="'+image+'" />' +
1841-
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:85px">Share</span>' : '') +
1842-
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="skewTdraw(\'' + vcallsign + '\')" style="top:115px">SkewT</span>' : '') +
1843-
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="openURL(\'' + grafana_dashboard_url + '\')" style="top:145px">Plots</span>' : '') +
1844+
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="shareVehicle(\'' + vcallsign + '\')" style="top:55px">Share</span>' : '') +
1845+
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="skewTdraw(\'' + vcallsign + '\')" style="top:85px">SkewT</span>' : '') +
1846+
((vehicle.vehicle_type!="car") ? '<span class="sbutton" onclick="openURL(\'' + grafana_dashboard_url + '\')" style="top:115px">Plots</span>' : '') +
18441847
'<div class="left">' +
18451848
'<dl>';
18461849
var b = '</dl>' +
@@ -2194,7 +2197,7 @@ function drawLaunchPrediction(vcallsign) {
21942197
color: balloon_colors[vehicle.color_index],
21952198
opacity: 0.4,
21962199
weight: 3,
2197-
}).addTo(map);
2200+
})//.addTo(map);
21982201

21992202
vehicle.prediction_launch_polyline.on('click', function (e) {
22002203
mapInfoBox_handle_prediction_path(e);
@@ -2257,45 +2260,43 @@ function redrawPrediction(vcallsign) {
22572260
vehicle.prediction_polyline.path_length = path_length;
22582261

22592262
var image_src;
2260-
if(vcallsign != "wb8elk2") { // WhiteStar
2261-
var html = "";
2262-
if(vehicle.prediction_target) {
2263-
vehicle.prediction_target.setLatLng(latlng);
2264-
} else {
2265-
image_src = host_url + markers_url + "target-" + balloon_colors_name[vehicle.color_index] + ".png";
2266-
predictionIcon = new L.icon({
2267-
iconUrl: image_src,
2268-
iconSize: [20,20],
2269-
iconAnchor: [10, 10],
2270-
});
2271-
vehicle.prediction_target = new L.Marker(latlng, {
2272-
zIndexOffset: Z_SHADOW,
2273-
icon: predictionIcon,
2274-
}).addTo(map);
2275-
vehicle.prediction_target.on('click', function (e) {
2276-
mapInfoBox_handle_prediction(e);
2277-
});
2278-
}
2279-
vehicle.prediction_target.pdata = data[data.length-1];
22802263

2281-
if(vehicle.prediction.descent_rate == null){
2282-
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Float\n";
2264+
var html = "";
2265+
if(vehicle.prediction_target) {
2266+
vehicle.prediction_target.setLatLng(latlng);
2267+
} else {
2268+
image_src = host_url + markers_url + "target-" + balloon_colors_name[vehicle.color_index] + ".png";
2269+
predictionIcon = new L.icon({
2270+
iconUrl: image_src,
2271+
iconSize: [20,20],
2272+
iconAnchor: [10, 10],
2273+
});
2274+
vehicle.prediction_target = new L.Marker(latlng, {
2275+
zIndexOffset: Z_SHADOW,
2276+
icon: predictionIcon,
2277+
})//addTo(map);
2278+
// vehicle.prediction_target.on('click', function (e) {
2279+
// mapInfoBox_handle_prediction(e);
2280+
// });
2281+
}
2282+
vehicle.prediction_target.pdata = data[data.length-1];
2283+
2284+
if(vehicle.prediction.descent_rate == null){
2285+
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Float\n";
2286+
} else {
2287+
if(vehicle.prediction.descending == 1){
2288+
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Standard \n" +
2289+
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
22832290
} else {
2284-
if(vehicle.prediction.descending == 1){
2285-
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Standard \n" +
2286-
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
2287-
} else {
2288-
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Standard \n" +
2289-
"<b>Ascent Rate:</b> " + vehicle.prediction.ascent_rate.toFixed(1) + " m/s \n" +
2290-
"<b>Burst Altitude:</b> " + vehicle.prediction.burst_altitude.toFixed(0) + " m\n" +
2291-
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
2292-
}
2291+
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Standard \n" +
2292+
"<b>Ascent Rate:</b> " + vehicle.prediction.ascent_rate.toFixed(1) + " m/s \n" +
2293+
"<b>Burst Altitude:</b> " + vehicle.prediction.burst_altitude.toFixed(0) + " m\n" +
2294+
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
22932295
}
2294-
} else {
2295-
if(vehicle.prediction_target) vehicle.prediction_target = null;
22962296
}
2297+
22972298

2298-
if(burst_index !== 0 && vcallsign != "wb8elk2") {
2299+
if(burst_index !== 0 ) {
22992300
if(vehicle.prediction_burst) {
23002301
vehicle.prediction_burst.setLatLng(latlng_burst);
23012302
} else {
@@ -3825,7 +3826,14 @@ function liveData() {
38253826
if ( document.getElementById("stTimer").classList.contains('friendly-dtime') ) {
38263827
document.getElementById("stTimer").classList.remove('friendly-dtime');
38273828
}
3828-
$("#stTimer").text(Math.round(messageRate/10) + " msg/s");
3829+
var tracking_sondes = clientTopic.length;
3830+
if (clientTopic[0] = "sondes-new/#"){ // need to subtract one if we are subbed to the slow feed
3831+
tracking_sondes = tracking_sondes - 1;
3832+
}
3833+
3834+
3835+
3836+
$("#stTimer").text(Math.round(messageRate/10) + " msg/s " + tracking_sondes + " sondes");
38293837
$("#updatedText").text(" ");
38303838
var dateNow = new Date().getTime();
38313839
try {
@@ -4791,6 +4799,7 @@ function update(response, none) {
47914799
};
47924800

47934801
ctx_init.run(ctx_init);
4802+
sub_to_nearby_sondes();
47944803
}
47954804

47964805
function zoom_on_payload() {

0 commit comments

Comments
 (0)