Improve aircraft icons and add weight-based color coding

- Replaced simple geometric shapes with detailed, realistic SVG icons for all aircraft types
- Implemented color differentiation based on aircraft weight categories:
  * Light (<7000kg): Sky blue
  * Medium (7000-34000kg): Green
  * Large (34000-136000kg): Orange
  * Heavy (>136000kg): Red
- Created new icons for: commercial airliner, helicopter, cargo aircraft, general aviation, military fighter, ground vehicle
- Updated legend to reflect new weight-based categories
- Modified getAircraftColor() to assign colors based on aircraft category/weight

Closes #17

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Ole-Morten Duesund 2025-08-24 20:16:25 +02:00
commit ed1e03382a
10 changed files with 175 additions and 42 deletions

View file

@ -215,7 +215,7 @@ export class AircraftManager {
createAircraftIcon(aircraft) {
const iconType = this.getAircraftIconType(aircraft);
const color = this.getAircraftColor(iconType);
const color = this.getAircraftColor(iconType, aircraft);
const size = aircraft.OnGround ? 12 : 16;
const rotation = aircraft.Track || 0;
@ -277,16 +277,38 @@ export class AircraftManager {
return 'commercial';
}
getAircraftColor(type) {
const colors = {
commercial: '#00ff88',
cargo: '#ff8c00',
military: '#ff4444',
ga: '#ffff00',
ground: '#888888',
helicopter: '#ff00ff' // Magenta for helicopters
};
return colors[type] || colors.commercial;
getAircraftColor(type, aircraft) {
// Special colors for specific types
if (type === 'military') return '#ff4444';
if (type === 'helicopter') return '#ff00ff';
if (type === 'ground') return '#888888';
if (type === 'ga') return '#ffff00';
// For commercial and cargo types, use weight-based colors
if (aircraft && aircraft.Category) {
const cat = aircraft.Category.toLowerCase();
// Check for specific weight ranges in the category string
// Light aircraft (< 7000kg) - Sky blue
if (cat.includes('light') || cat.includes('7000kg')) {
return '#00bfff';
}
// Medium aircraft (7000-34000kg) - Green
if (cat.includes('medium 7000')) {
return '#00ff88';
}
// Large aircraft (34000-136000kg) - Orange
if (cat.includes('medium 34000') || cat.includes('large')) {
return '#ff8c00';
}
// Heavy aircraft (> 136000kg) - Red
if (cat.includes('heavy') || cat.includes('136000kg') || cat.includes('super')) {
return '#ff0000';
}
}
// Default to green for unknown commercial aircraft
return '#00ff88';
}