From 0bd6cae0a681ad954cc26fbd1f2c0d76cb3ec80e Mon Sep 17 00:00:00 2001 From: James Smith Date: Tue, 30 Dec 2025 15:50:43 +0000 Subject: [PATCH] Fix satellite dashboard orbit track visibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The orbit track was being added correctly but wasn't visible because the map was zoomed to the pass ground track (a small arc). Now the map fits bounds to include the full orbit track plus observer location after adding the orbit layer. Also removed debug console.log statements. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- templates/satellite_dashboard.html | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/templates/satellite_dashboard.html b/templates/satellite_dashboard.html index 9035d22..404697b 100644 --- a/templates/satellite_dashboard.html +++ b/templates/satellite_dashboard.html @@ -1367,16 +1367,11 @@ let targetSatellite = selectedSatellite; let satColor = satellites[selectedSatellite]?.color || '#00d4ff'; - console.log('updateRealTimePositions - selectedPass:', selectedPass, 'passes.length:', passes.length); - if (selectedPass !== null && passes[selectedPass]) { const pass = passes[selectedPass]; // Use the satellite name from the pass (backend accepts names or NORAD IDs) targetSatellite = pass.satellite; satColor = pass.color || satColor; - console.log('Using pass satellite:', targetSatellite, 'color:', satColor); - } else { - console.log('No pass selected, using dropdown satellite:', targetSatellite); } try { @@ -1392,10 +1387,8 @@ }); const data = await response.json(); - console.log('Position response:', data); if (data.status === 'success' && data.positions.length > 0) { const pos = data.positions[0]; - console.log('Position data:', pos.satellite, 'lat:', pos.lat, 'lon:', pos.lon, 'has track:', !!pos.track, 'track length:', pos.track?.length); // Update telemetry document.getElementById('telLat').textContent = pos.lat.toFixed(4) + '°'; @@ -1409,7 +1402,6 @@ document.getElementById('statVisible').textContent = pos.elevation > 0 ? '1' : '0'; // Update satellite marker on map - console.log('Updating map, groundMap exists:', !!groundMap); if (groundMap) { if (satMarker) groundMap.removeLayer(satMarker); @@ -1426,18 +1418,14 @@ iconAnchor: [10, 10] }); satMarker = L.marker([pos.lat, pos.lon], { icon: satIcon }).addTo(groundMap); - console.log('Satellite marker added at', pos.lat, pos.lon); } // Always show full orbit track from position data - console.log('Drawing orbit track, pos.track exists:', !!pos.track, 'groundMap exists:', !!groundMap); if (pos.track && groundMap) { if (orbitTrack) { - console.log('Removing old orbitTrack'); groundMap.removeLayer(orbitTrack); } if (trackLine) { - console.log('Removing old trackLine'); groundMap.removeLayer(trackLine); trackLine = null; } @@ -1465,19 +1453,25 @@ } // Draw each segment as separate polyline - console.log('Created', segments.length, 'segments, total points:', segments.reduce((sum, s) => sum + s.length, 0)); orbitTrack = L.layerGroup(); + const allOrbitCoords = []; segments.forEach((seg, i) => { - console.log('Adding segment', i, 'with', seg.length, 'points'); L.polyline(seg, { color: satColor, weight: 2, opacity: 0.6, dashArray: '5, 5' }).addTo(orbitTrack); + allOrbitCoords.push(...seg); }); orbitTrack.addTo(groundMap); - console.log('Orbit track added to map'); + + // Fit map to show the full orbit track + if (allOrbitCoords.length > 0) { + // Add observer location to bounds + allOrbitCoords.push([lat, lon]); + groundMap.fitBounds(L.latLngBounds(allOrbitCoords), { padding: [30, 30] }); + } } // Update polar plot - preserve pass trajectory if selected