fix(flights): a trail does not join its track history across a landing or take-off that was not seen

This commit is contained in:
Sameh Khamis committed 2026-11-13 12:53:18 -08:00
1 parent 693faae44e
commit 7e45d4d989
7 files changed
+215 -12

No files matched your search

+3
View File
@@ -113,6 +113,9 @@ export function createFlightSnapshotRenderer({
// Drawn at an invented height: a trail seeded from history keeps no
// position for it.
inventedHeight: meta.renderAltitudeInvented === true,
// Whether this report was on the ground: a trail backfill joins it
// only across a landing or take-off it saw.
onGround: meta.onGround === true,
});
if (history.length > POSITION_HISTORY_LIMIT) {
history.shift();
+8 -1
View File
@@ -550,7 +550,7 @@ export function createTracking({
clone(fix.position),
historyFixEpochMs(fix),
TRAIL_MAX_POINTS,
{ nullAltitude: fix.inventedHeight === true },
{ nullAltitude: fix.inventedHeight === true, onGround: fix.onGround },
);
}
if (!flightState._trail && flightState._viewer) {
@@ -677,10 +677,17 @@ export function createTracking({
};
}),
);
// A history that ends in the air does not join an aircraft now on the
// ground (or the reverse) across a landing or take-off nobody saw.
flightState._trailFixes = joinTrailBackfill(
backfill,
flightState._trailFixes,
TRAIL_MAX_POINTS,
{
backfillEndsOnGround: parsed[parsed.length - 1].onGround,
onGroundNow: flightState.records.data.get(icao24)?.onGround,
nowMs: flightState.now(),
},
);
_refreshTrailDisplay();
}
+3
View File
@@ -87,6 +87,9 @@ export function createMilitarySnapshotRenderer({
// Drawn at an invented height: a trail seeded from history keeps no
// position for it.
inventedHeight: meta.renderAltitudeInvented === true,
// Whether this report was on the ground: a trail backfill joins it
// only across a landing or take-off it saw.
onGround: meta.onGround === true,
});
if (history.length > POSITION_HISTORY_LIMIT) {
history.shift();
+8 -1
View File
@@ -752,7 +752,7 @@ export function createTracking({
_trailFloorPosition(clone(fix.position)),
historyFixEpochMs(fix),
TRAIL_MAX_POINTS,
{ nullAltitude: fix.inventedHeight === true },
{ nullAltitude: fix.inventedHeight === true, onGround: fix.onGround },
);
}
if (!flightState._trail && flightState._viewer) {
@@ -881,10 +881,17 @@ export function createTracking({
};
}),
);
// A history that ends in the air does not join an aircraft now on the
// ground (or the reverse) across a landing or take-off nobody saw.
flightState._trailFixes = joinTrailBackfill(
backfill,
flightState._trailFixes,
TRAIL_MAX_POINTS,
{
backfillEndsOnGround: parsed[parsed.length - 1].onGround,
onGroundNow: flightState.records.data.get(icao24)?.onGround,
nowMs: flightState.now(),
},
);
_refreshTrailDisplay();
}