Fix satellite marker disappearing when changing passes

When removing map layers, set references to null so new markers get
created properly on position updates. Also clear orbit track lines
when changing passes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
James Smith
2025-12-30 15:35:49 +00:00
parent fc5a4b1b6b
commit 43ff1a8b74
2 changed files with 29 additions and 6 deletions

View File

@@ -1161,10 +1161,19 @@
function updateGroundTrack(pass) {
if (!groundMap) return;
// Clear all existing map layers
if (trackLine) groundMap.removeLayer(trackLine);
if (satMarker) groundMap.removeLayer(satMarker);
if (orbitTrack) groundMap.removeLayer(orbitTrack);
// Clear all existing map layers and reset references
if (trackLine) {
groundMap.removeLayer(trackLine);
trackLine = null;
}
if (satMarker) {
groundMap.removeLayer(satMarker);
satMarker = null;
}
if (orbitTrack) {
groundMap.removeLayer(orbitTrack);
orbitTrack = null;
}
if (pass && pass.groundTrack) {
// Split track at antimeridian crossings to avoid lines across map