Fix Show Radar Display checkbox not working in Aircraft tab

Added toggleAircraftRadar() function and onchange handler to the
checkbox. Also updated switchMode() to respect the checkbox state
when switching to aircraft mode.

🤖 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 23:14:33 +00:00
parent ddbed245e1
commit 9742c269cb

View File

@@ -3499,7 +3499,7 @@
</div>
<div class="checkbox-group">
<label>
<input type="checkbox" id="adsbEnableMap" checked>
<input type="checkbox" id="adsbEnableMap" checked onchange="toggleAircraftRadar()">
Show Radar Display
</label>
</div>
@@ -4648,7 +4648,9 @@
document.getElementById('activeModeIndicator').innerHTML = '<span class="pulse-dot"></span>' + modeNames[mode];
document.getElementById('wifiVisuals').style.display = mode === 'wifi' ? 'grid' : 'none';
document.getElementById('btVisuals').style.display = mode === 'bluetooth' ? 'grid' : 'none';
document.getElementById('aircraftVisuals').style.display = mode === 'aircraft' ? 'grid' : 'none';
// Respect the "Show Radar Display" checkbox for aircraft mode
const showRadar = document.getElementById('adsbEnableMap').checked;
document.getElementById('aircraftVisuals').style.display = (mode === 'aircraft' && showRadar) ? 'grid' : 'none';
document.getElementById('satelliteVisuals').style.display = mode === 'satellite' ? 'block' : 'none';
// Update output panel title based on mode
@@ -8250,6 +8252,14 @@
}
}
function toggleAircraftRadar() {
const enabled = document.getElementById('adsbEnableMap').checked;
const visuals = document.getElementById('aircraftVisuals');
if (visuals && currentMode === 'aircraft') {
visuals.style.display = enabled ? 'grid' : 'none';
}
}
function applyAircraftFilter() {
// Clear all markers and redraw with new filter
Object.keys(aircraftMarkers).forEach(icao => {