mirror of
https://github.com/smittix/intercept.git
synced 2026-07-25 17:28:11 -07:00
Fix satellite dashboard map - remove old track lines properly
- Clear trackLine, satMarker, and orbitTrack before adding new ones - Remove duplicate cleanup code - Clear pass track when showing live orbit to avoid confusion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -13495,9 +13495,10 @@ def satellite_dashboard():
|
|||||||
function updateGroundTrack(pass) {
|
function updateGroundTrack(pass) {
|
||||||
if (!groundMap) return;
|
if (!groundMap) return;
|
||||||
|
|
||||||
// Clear existing
|
// Clear all existing map layers
|
||||||
if (trackLine) groundMap.removeLayer(trackLine);
|
if (trackLine) groundMap.removeLayer(trackLine);
|
||||||
if (satMarker) groundMap.removeLayer(satMarker);
|
if (satMarker) groundMap.removeLayer(satMarker);
|
||||||
|
if (orbitTrack) groundMap.removeLayer(orbitTrack);
|
||||||
|
|
||||||
if (pass && pass.groundTrack) {
|
if (pass && pass.groundTrack) {
|
||||||
const coords = pass.groundTrack.map(pt => [pt.lat, pt.lon]);
|
const coords = pass.groundTrack.map(pt => [pt.lat, pt.lon]);
|
||||||
@@ -13695,9 +13696,12 @@ def satellite_dashboard():
|
|||||||
satMarker = L.marker([pos.lat, pos.lon], { icon: satIcon }).addTo(groundMap);
|
satMarker = L.marker([pos.lat, pos.lon], { icon: satIcon }).addTo(groundMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update orbit track
|
// Update orbit track (clear old track first)
|
||||||
if (pos.track && groundMap) {
|
if (pos.track && groundMap) {
|
||||||
if (orbitTrack) groundMap.removeLayer(orbitTrack);
|
if (orbitTrack) groundMap.removeLayer(orbitTrack);
|
||||||
|
if (trackLine) groundMap.removeLayer(trackLine);
|
||||||
|
trackLine = null; // Clear pass track when showing live orbit
|
||||||
|
|
||||||
orbitTrack = L.polyline(pos.track.map(p => [p.lat, p.lon]), {
|
orbitTrack = L.polyline(pos.track.map(p => [p.lat, p.lon]), {
|
||||||
color: satColor,
|
color: satColor,
|
||||||
weight: 2,
|
weight: 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user