From f1e55fc44c65c8ddeec1f2087346f489c49ddae7 Mon Sep 17 00:00:00 2001 From: James Smith Date: Tue, 30 Dec 2025 15:18:10 +0000 Subject: [PATCH] Fix trackLine.getBounds error in satellite dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LayerGroup doesn't have getBounds() like polyline does. Collect all coordinates and create bounds manually using L.latLngBounds(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- templates/satellite_dashboard.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/satellite_dashboard.html b/templates/satellite_dashboard.html index f322bab..6a4beca 100644 --- a/templates/satellite_dashboard.html +++ b/templates/satellite_dashboard.html @@ -1189,6 +1189,7 @@ // Draw each segment as separate polyline trackLine = L.layerGroup(); + const allCoords = []; segments.forEach(seg => { L.polyline(seg, { color: pass.color || '#00d4ff', @@ -1196,6 +1197,7 @@ opacity: 0.8, dashArray: '10, 5' }).addTo(trackLine); + allCoords.push(...seg); }); trackLine.addTo(groundMap); @@ -1219,7 +1221,10 @@ .bindPopup(`${pass.name}
Alt: ${pass.currentPos.alt?.toFixed(0)} km`); } - groundMap.fitBounds(trackLine.getBounds(), { padding: [30, 30] }); + // Fit bounds using collected coordinates + if (allCoords.length > 0) { + groundMap.fitBounds(L.latLngBounds(allCoords), { padding: [30, 30] }); + } } }