diff --git a/assets/static/js/modules/aircraft-manager.js b/assets/static/js/modules/aircraft-manager.js index 7b4dd2a..a5351cb 100644 --- a/assets/static/js/modules/aircraft-manager.js +++ b/assets/static/js/modules/aircraft-manager.js @@ -141,14 +141,57 @@ export class AircraftManager { const color = this.getAircraftColor(type); const size = aircraft.OnGround ? 12 : 16; + // Create different SVG shapes based on aircraft type + let aircraftPath; + + switch (type) { + case 'helicopter': + // Helicopter shape with rotor disc + aircraftPath = ` + + + + + `; + break; + case 'military': + // Swept-wing fighter jet shape + aircraftPath = ` + + `; + break; + case 'cargo': + // Wide-body cargo aircraft shape + aircraftPath = ` + + + `; + break; + case 'ga': + // Small general aviation aircraft + aircraftPath = ` + + `; + break; + case 'ground': + // Ground vehicle - simplified truck/car shape + aircraftPath = ` + + + + `; + break; + default: + // Default commercial aircraft shape + aircraftPath = ` + + `; + } + const svg = ` - + ${aircraftPath} `; @@ -163,17 +206,43 @@ export class AircraftManager { getAircraftType(aircraft) { if (aircraft.OnGround) return 'ground'; + + // Use ADS-B Category field for proper aircraft classification if (aircraft.Category) { const cat = aircraft.Category.toLowerCase(); - if (cat.includes('military')) return 'military'; - if (cat.includes('cargo') || cat.includes('heavy')) return 'cargo'; - if (cat.includes('light') || cat.includes('glider')) return 'ga'; + + // Standard ADS-B aircraft categories - check specific terms first + if (cat.includes('helicopter') || cat.includes('rotorcraft') || cat.includes('gyrocopter')) return 'helicopter'; + if (cat.includes('military') || cat.includes('fighter') || cat.includes('bomber')) return 'military'; + + // ADS-B weight-based categories (RTCA DO-260B standard) + if (cat.includes('heavy') || cat.includes('super') || cat.includes('136000kg')) return 'cargo'; // Heavy/Super category + if (cat.includes('light') || cat.includes('15500kg') || cat.includes('5700kg') || cat.includes('glider') || cat.includes('ultralight') || cat.includes('sport')) return 'ga'; // Light categories + if (cat.includes('medium') || cat.includes('34000kg')) return 'commercial'; // Medium category - typically commercial airliners + + // Specific aircraft type categories + if (cat.includes('cargo') || cat.includes('transport') || cat.includes('freighter')) return 'cargo'; + if (cat.includes('airliner') || cat.includes('jet') || cat.includes('turboprop')) return 'commercial'; } + + // Fallback to callsign analysis for classification if (aircraft.Callsign) { const cs = aircraft.Callsign.toLowerCase(); - if (cs.includes('mil') || cs.includes('army') || cs.includes('navy')) return 'military'; - if (cs.includes('cargo') || cs.includes('fedex') || cs.includes('ups')) return 'cargo'; + + // Helicopter identifiers + if (cs.includes('heli') || cs.includes('rescue') || cs.includes('medevac') || cs.includes('lifeguard') || + cs.includes('police') || cs.includes('sheriff') || cs.includes('medic')) return 'helicopter'; + + // Military identifiers + if (cs.includes('mil') || cs.includes('army') || cs.includes('navy') || cs.includes('air force') || + cs.includes('usaf') || cs.includes('usmc') || cs.includes('uscg')) return 'military'; + + // Cargo identifiers + if (cs.includes('cargo') || cs.includes('fedex') || cs.includes('ups') || cs.includes('dhl') || + cs.includes('freight') || cs.includes('express')) return 'cargo'; } + + // Default to commercial for unclassified aircraft return 'commercial'; } @@ -183,7 +252,8 @@ export class AircraftManager { cargo: '#ff8c00', military: '#ff4444', ga: '#ffff00', - ground: '#888888' + ground: '#888888', + helicopter: '#ff00ff' // Magenta for helicopters }; return colors[type] || colors.commercial; }