mirror of
https://github.com/smittix/intercept.git
synced 2026-04-24 06:40:00 -07:00
Fix groundTrackLine.getBounds error in satellite tab
Same fix as dashboard: LayerGroup doesn't have getBounds(), so 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 <noreply@anthropic.com>
This commit is contained in:
@@ -8384,6 +8384,7 @@
|
||||
|
||||
// Draw ground track segments
|
||||
groundTrackLine = L.layerGroup();
|
||||
const allCoords = [];
|
||||
segments.forEach(seg => {
|
||||
L.polyline(seg, {
|
||||
color: pass.color || '#00ff00',
|
||||
@@ -8391,6 +8392,7 @@
|
||||
opacity: 0.8,
|
||||
dashArray: '5, 5'
|
||||
}).addTo(groundTrackLine);
|
||||
allCoords.push(...seg);
|
||||
});
|
||||
groundTrackLine.addTo(groundTrackMap);
|
||||
|
||||
@@ -8414,8 +8416,8 @@
|
||||
}
|
||||
|
||||
// Fit bounds to show track
|
||||
if (segments.length > 0) {
|
||||
groundTrackMap.fitBounds(groundTrackLine.getBounds(), { padding: [20, 20] });
|
||||
if (allCoords.length > 0) {
|
||||
groundTrackMap.fitBounds(L.latLngBounds(allCoords), { padding: [20, 20] });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user