Skip to content

Commit c4f6e26

Browse files
Mark JessopMark Jessop
authored andcommitted
Add burst/landing prediction details, and geo link to predicted landing location.
1 parent 1a0d543 commit c4f6e26

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

js/tracker.js

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,20 @@ function redrawPrediction(vcallsign) {
20952095
});
20962096
}
20972097
vehicle.prediction_target.pdata = data[data.length-1];
2098+
2099+
if(vehicle.prediction.descent_rate == null){
2100+
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Float\n";
2101+
} else {
2102+
if(vehicle.prediction.descending == 1){
2103+
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Standard \n" +
2104+
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
2105+
} else {
2106+
vehicle.prediction_target.pred_type = "<b>Prediction Type:</b> Standard \n" +
2107+
"<b>Ascent Rate:</b> " + vehicle.prediction.ascent_rate.toFixed(1) + " m/s \n" +
2108+
"<b>Burst Altitude:</b> " + vehicle.prediction.burst_altitude.toFixed(0) + " m\n" +
2109+
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
2110+
}
2111+
}
20982112
} else {
20992113
if(vehicle.prediction_target) vehicle.prediction_target = null;
21002114
}
@@ -2118,6 +2132,19 @@ function redrawPrediction(vcallsign) {
21182132
});
21192133
}
21202134
vehicle.prediction_burst.pdata = data[burst_index];
2135+
if(vehicle.prediction.descent_rate == null){
2136+
vehicle.prediction_burst.pred_type = "<b>Prediction Type:</b> Float\n";
2137+
} else {
2138+
if(vehicle.prediction.descending == 1){
2139+
vehicle.prediction_burst.pred_type = "<b>Prediction Type:</b> Standard \n" +
2140+
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
2141+
} else {
2142+
vehicle.prediction_burst.pred_type = "<b>Prediction Type:</b> Standard \n" +
2143+
"<b>Ascent Rate:</b> " + vehicle.prediction.ascent_rate.toFixed(1) + " m/s \n" +
2144+
"<b>Burst Altitude:</b> " + vehicle.prediction.burst_altitude.toFixed(0) + " m\n" +
2145+
"<b>Descent Rate:</b> " + vehicle.prediction.descent_rate.toFixed(1) + " m/s \n";
2146+
}
2147+
}
21212148
} else {
21222149
if(vehicle.prediction_burst) vehicle.prediction_burst = null;
21232150
}
@@ -2533,8 +2560,8 @@ function mapInfoBox_handle_prediction(event) {
25332560
mapInfoBox.setContent("<pre>" +
25342561
formatDate(new Date(parseInt(data.time) * 1000), true) + "\n\n" +
25352562
"<b>Altitude:</b> " + altitude + "\n" +
2536-
"<b>Latitude:</b> " + data.lat + "\n" +
2537-
"<b>Longitude:</b> " + data.lon + "\n" +
2563+
"<b>Location:</b> <a href='geo:" + data.lat.toFixed(5) + "," + data.lon.toFixed(5) + "'>" + data.lat.toFixed(5) + ", " + data.lon.toFixed(5) + "</a>\n" +
2564+
event.target.pred_type +
25382565
"</pre>"
25392566
);
25402567
mapInfoBox.setLatLng(event.latlng);

0 commit comments

Comments
 (0)