fix(satellite): populate currentPos with full telemetry in pass predictions

Previously currentPos only had lat/lon, so the updateTelemetry fallback
(used before first live position arrives) always showed '---' for
altitude/elevation/azimuth/distance. currentPos now includes all fields
computed from the request observer location. updateTelemetry simplified
to delegate to applyTelemetryPosition.
This commit is contained in:
James Smith
2026-03-19 21:48:33 +00:00
parent d84237dbb4
commit d240ae06e3
3 changed files with 34 additions and 15 deletions

View File

@@ -2404,21 +2404,9 @@
clearTelemetry();
return;
}
const pos = pass.currentPos;
const telLat = document.getElementById('telLat');
const telLon = document.getElementById('telLon');
const telAlt = document.getElementById('telAlt');
const telEl = document.getElementById('telEl');
const telAz = document.getElementById('telAz');
const telDist = document.getElementById('telDist');
if (telLat) telLat.textContent = Number.isFinite(pos.lat) ? pos.lat.toFixed(4) + '°' : '---.----';
if (telLon) telLon.textContent = Number.isFinite(pos.lon) ? pos.lon.toFixed(4) + '°' : '---.----';
if (telAlt && Number.isFinite(pos.alt)) telAlt.textContent = pos.alt.toFixed(0) + ' km';
if (telEl && Number.isFinite(pos.el)) telEl.textContent = pos.el.toFixed(1) + '°';
if (telAz && Number.isFinite(pos.az)) telAz.textContent = pos.az.toFixed(1) + '°';
if (telDist && Number.isFinite(pos.dist)) telDist.textContent = pos.dist.toFixed(0) + ' km';
// currentPos now contains full position data (lat, lon, altitude,
// elevation, azimuth, distance, visible) from the predict endpoint.
applyTelemetryPosition(pass.currentPos);
}
function updateCountdown() {