Hand the host's live placement the ground under each aircraft

A landing is judged by its height above the ground, which the drawn
height alone does not give at a high airport. Records keep the ground
the warm cache already reads (the surface a grounded contact stands on,
the floor under a low contact near the view or tracked) as groundM, in
the render height's reference, and observeLiveAircraft passes it on; NaN
where the layer does not know it.
This commit is contained in:
Sameh Khamis committed 2026-11-17 19:46:19 -08:00
1 parent 4c90c065be
commit 46d8a19e98
4 files changed
+58 -8

No files matched your search

+5 -2
View File
@@ -95,13 +95,15 @@ export function forgetPlacedAircraft(placement, ids) {
* Tell the host-supplied placement an aircraft's fix as the layer took it
* (nothing while the layer follows the world clock): its own time, its
* position, the height the layer draws it at (NaN when that height is
* invented), and its reported speed, course and ground state.
* invented), the ground under it in that height's reference (NaN where the
* layer does not know it), and its reported speed, course and ground state.
* @param {object} flightState
* @param {object|null|undefined} placement
* @param {string} icao24
* @param {number} fixEpochMs
* @param {{rawLat: number, rawLon: number, renderAltitudeM: number,
* renderAltitudeInvented?: boolean, onGround?: boolean}} meta
* renderAltitudeInvented?: boolean, groundM?: number|null,
* onGround?: boolean}} meta
* @param {number|null|undefined} speedMps
* @param {number|null|undefined} courseDeg
*/
@@ -121,6 +123,7 @@ export function observeLiveAircraft(
lon: meta.rawLon,
altitudeM:
meta.renderAltitudeInvented === true ? NaN : meta.renderAltitudeM,
groundM: Number.isFinite(meta.groundM) ? meta.groundM : NaN,
speedMps: Number.isFinite(speedMps) ? speedMps : NaN,
courseDeg: Number.isFinite(courseDeg) ? courseDeg : NaN,
headingDeg: NaN,