Skip to content

Commit eff8aa0

Browse files
committed
Re-enable zooming to payload on page load if one sonde is filtered
1 parent 00e911b commit eff8aa0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

js/tracker.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,7 @@ function addPosition(position) {
21182118
else if(dt >= 0) {
21192119
if(vehicle.num_positions > 0) {
21202120
// calculate vertical rate
2121+
// TODO - Make this average over more points rather than use a FIR.
21212122
var rate = (position.gps_alt - vehicle.curr_position.gps_alt) / dt;
21222123
vehicle.ascent_rate = 0.7 * rate + 0.3 * vehicle.ascent_rate;
21232124

@@ -3057,8 +3058,10 @@ function update(response) {
30573058
offline.set('positions', ctx.lastPositions);
30583059

30593060
if (got_positions && !zoomed_in && Object.keys(vehicles).length) {
3060-
// Disable for now.
3061-
//zoom_on_payload();
3061+
// Enable zooming when we only have a single payload filtered.
3062+
if(Object.keys(vehicles).length == 1){
3063+
zoom_on_payload();
3064+
}
30623065
}
30633066

30643067
if(periodical_predictions === null) refreshPredictions();

0 commit comments

Comments
 (0)