Clean up excessive console logging and remove duplicate app files
- Remove verbose console.log statements from WebSocket, map, and aircraft managers - Keep essential error messages and warnings for debugging - Consolidate app-new.js into app.js to eliminate confusing duplicate files - Update HTML reference to use clean app.js with incremented cache version - Significantly reduce console noise for better user experience 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
e51af89d84
commit
776cef1185
7 changed files with 174 additions and 1415 deletions
|
|
@ -22,7 +22,6 @@ export class AircraftManager {
|
|||
for (const [icao, aircraft] of Object.entries(data.aircraft)) {
|
||||
this.aircraftData.set(icao, aircraft);
|
||||
}
|
||||
console.log(`Aircraft data updated: ${this.aircraftData.size} aircraft`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -57,9 +56,6 @@ export class AircraftManager {
|
|||
updateAircraftMarker(icao, aircraft) {
|
||||
const pos = [aircraft.Latitude, aircraft.Longitude];
|
||||
|
||||
// Debug: Log coordinate format and values
|
||||
console.log(`📍 ${icao}: pos=[${pos[0]}, ${pos[1]}], types=[${typeof pos[0]}, ${typeof pos[1]}]`);
|
||||
console.log(`🔍 Marker check for ${icao}: has=${this.aircraftMarkers.has(icao)}, map_size=${this.aircraftMarkers.size}`);
|
||||
|
||||
// Check for invalid coordinates - proper geographic bounds
|
||||
const isValidLat = pos[0] >= -90 && pos[0] <= 90;
|
||||
|
|
@ -76,7 +72,6 @@ export class AircraftManager {
|
|||
|
||||
// Always update position - let Leaflet handle everything
|
||||
const oldPos = marker.getLatLng();
|
||||
console.log(`🔄 Updating ${icao}: [${oldPos.lat}, ${oldPos.lng}] -> [${pos[0]}, ${pos[1]}]`);
|
||||
marker.setLatLng(pos);
|
||||
|
||||
// Update rotation using Leaflet's options if available, otherwise skip rotation
|
||||
|
|
@ -100,7 +95,6 @@ export class AircraftManager {
|
|||
|
||||
} else {
|
||||
// Create new marker
|
||||
console.log(`Creating new marker for ${icao}`);
|
||||
const icon = this.createAircraftIcon(aircraft);
|
||||
|
||||
try {
|
||||
|
|
@ -116,14 +110,12 @@ export class AircraftManager {
|
|||
|
||||
this.aircraftMarkers.set(icao, marker);
|
||||
this.markerCreateCount++;
|
||||
console.log(`Created marker for ${icao}, total markers: ${this.aircraftMarkers.size}`);
|
||||
|
||||
// Force immediate visibility
|
||||
if (marker._icon) {
|
||||
marker._icon.style.display = 'block';
|
||||
marker._icon.style.opacity = '1';
|
||||
marker._icon.style.visibility = 'visible';
|
||||
console.log(`Forced visibility for new marker ${icao}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Failed to create marker for ${icao}:`, error);
|
||||
|
|
@ -442,8 +434,4 @@ export class AircraftManager {
|
|||
}
|
||||
}
|
||||
|
||||
// Simple debug method
|
||||
debugState() {
|
||||
console.log(`Aircraft: ${this.aircraftData.size}, Markers: ${this.aircraftMarkers.size}`);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue