Move documentation to docs/ directory and improve terminology
- Move ARCHITECTURE.md and CLAUDE.md to docs/ directory - Replace "real-time" terminology with accurate "low-latency" and "high-performance" - Update README to reflect correct performance characteristics - Add comprehensive ICAO country database with SQLite backend - Fix display options positioning and functionality - Add map scale controls and improved range ring visibility - Enhance aircraft marker orientation and trail management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
43e55b2ba0
commit
20bdcf54ec
15 changed files with 746 additions and 67 deletions
|
|
@ -22,6 +22,10 @@ class SkyView {
|
|||
// Charts
|
||||
this.charts = {};
|
||||
|
||||
// Selected aircraft tracking
|
||||
this.selectedAircraft = null;
|
||||
this.selectedTrailEnabled = false;
|
||||
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
|
@ -40,6 +44,11 @@ class SkyView {
|
|||
// Initialize aircraft manager with the map
|
||||
this.aircraftManager = new AircraftManager(map);
|
||||
|
||||
// Set up selected aircraft trail callback
|
||||
this.aircraftManager.setSelectedAircraftCallback((icao) => {
|
||||
return this.selectedTrailEnabled && this.selectedAircraft === icao;
|
||||
});
|
||||
|
||||
// Initialize WebSocket with callbacks
|
||||
this.wsManager = new WebSocketManager(
|
||||
(message) => this.handleWebSocketMessage(message),
|
||||
|
|
@ -71,11 +80,12 @@ class SkyView {
|
|||
const centerMapBtn = document.getElementById('center-map');
|
||||
const resetMapBtn = document.getElementById('reset-map');
|
||||
const toggleTrailsBtn = document.getElementById('toggle-trails');
|
||||
const toggleRangeBtn = document.getElementById('toggle-range');
|
||||
const toggleSourcesBtn = document.getElementById('toggle-sources');
|
||||
|
||||
if (centerMapBtn) {
|
||||
centerMapBtn.addEventListener('click', () => this.aircraftManager.centerMapOnAircraft());
|
||||
centerMapBtn.addEventListener('click', () => {
|
||||
this.aircraftManager.centerMapOnAircraft(() => this.mapManager.getSourcePositions());
|
||||
});
|
||||
}
|
||||
|
||||
if (resetMapBtn) {
|
||||
|
|
@ -89,12 +99,6 @@ class SkyView {
|
|||
});
|
||||
}
|
||||
|
||||
if (toggleRangeBtn) {
|
||||
toggleRangeBtn.addEventListener('click', () => {
|
||||
const showRange = this.mapManager.toggleRangeCircles();
|
||||
toggleRangeBtn.textContent = showRange ? 'Hide Range' : 'Show Range';
|
||||
});
|
||||
}
|
||||
|
||||
if (toggleSourcesBtn) {
|
||||
toggleSourcesBtn.addEventListener('click', () => {
|
||||
|
|
@ -128,6 +132,50 @@ class SkyView {
|
|||
this.mapManager.updateCoverageDisplay();
|
||||
});
|
||||
}
|
||||
|
||||
// Display option checkboxes
|
||||
const sitePositionsCheckbox = document.getElementById('show-site-positions');
|
||||
const rangeRingsCheckbox = document.getElementById('show-range-rings');
|
||||
const selectedTrailCheckbox = document.getElementById('show-selected-trail');
|
||||
|
||||
if (sitePositionsCheckbox) {
|
||||
sitePositionsCheckbox.addEventListener('change', (e) => {
|
||||
if (e.target.checked) {
|
||||
this.mapManager.showSources = true;
|
||||
this.mapManager.updateSourceMarkers();
|
||||
} else {
|
||||
this.mapManager.showSources = false;
|
||||
this.mapManager.sourceMarkers.forEach(marker => this.mapManager.map.removeLayer(marker));
|
||||
this.mapManager.sourceMarkers.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (rangeRingsCheckbox) {
|
||||
rangeRingsCheckbox.addEventListener('change', (e) => {
|
||||
if (e.target.checked) {
|
||||
this.mapManager.showRange = true;
|
||||
this.mapManager.updateRangeCircles();
|
||||
} else {
|
||||
this.mapManager.showRange = false;
|
||||
this.mapManager.rangeCircles.forEach(circle => this.mapManager.map.removeLayer(circle));
|
||||
this.mapManager.rangeCircles.clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (selectedTrailCheckbox) {
|
||||
selectedTrailCheckbox.addEventListener('change', (e) => {
|
||||
this.selectedTrailEnabled = e.target.checked;
|
||||
if (!e.target.checked && this.selectedAircraft) {
|
||||
// Hide currently selected aircraft trail
|
||||
this.aircraftManager.hideAircraftTrail(this.selectedAircraft);
|
||||
} else if (e.target.checked && this.selectedAircraft) {
|
||||
// Show currently selected aircraft trail
|
||||
this.aircraftManager.showAircraftTrail(this.selectedAircraft);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setupAircraftSelection() {
|
||||
|
|
@ -135,6 +183,19 @@ class SkyView {
|
|||
const { icao, aircraft } = e.detail;
|
||||
this.uiManager.switchView('map-view');
|
||||
|
||||
// Hide trail for previously selected aircraft
|
||||
if (this.selectedAircraft && this.selectedTrailEnabled) {
|
||||
this.aircraftManager.hideAircraftTrail(this.selectedAircraft);
|
||||
}
|
||||
|
||||
// Update selected aircraft
|
||||
this.selectedAircraft = icao;
|
||||
|
||||
// Show trail for newly selected aircraft if enabled
|
||||
if (this.selectedTrailEnabled) {
|
||||
this.aircraftManager.showAircraftTrail(icao);
|
||||
}
|
||||
|
||||
// DON'T change map view - just open popup like Leaflet expects
|
||||
if (this.mapManager.map && aircraft.Latitude && aircraft.Longitude) {
|
||||
const marker = this.aircraftManager.aircraftMarkers.get(icao);
|
||||
|
|
@ -171,6 +232,11 @@ class SkyView {
|
|||
this.uiManager.updateStatistics();
|
||||
this.uiManager.updateHeaderInfo();
|
||||
|
||||
// Clear selected aircraft if it no longer exists
|
||||
if (this.selectedAircraft && !this.aircraftManager.aircraftData.has(this.selectedAircraft)) {
|
||||
this.selectedAircraft = null;
|
||||
}
|
||||
|
||||
// Update coverage controls
|
||||
this.mapManager.updateCoverageControls();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue