feat: Improve aircraft legend clarity and icon differentiation
Resolves issue #13 by implementing comprehensive aircraft legend improvements: ## New Features - **Size-based aircraft icons**: Created distinct SVG icons for light, medium, large, and heavy aircraft with progressively larger visual representations - **Visual aircraft icons in legend**: Replaced colored squares with actual aircraft silhouettes showing relative sizes and types - **Enhanced categorization**: Added military category to legend and improved icon selection logic ## Improvements - **Better differentiation**: Each weight class now has a unique icon shape, not just color - **Accurate ADS-B mapping**: Icons correctly map to decoded ADS-B emitter categories - **Clearer legend display**: Users can now see actual aircraft shapes instead of generic colored rectangles ## Technical Changes - Created 4 new SVG icons: light.svg, medium.svg, large.svg, heavy.svg - Updated legend HTML to embed aircraft SVG icons inline - Enhanced JavaScript logic to better match categories to appropriate icon types - Simplified color mapping function for cleaner code This addresses the original concerns about confusing legend entries and lack of visual differentiation between aircraft types. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
93b74e3d5c
commit
7461d881cf
7 changed files with 276 additions and 64 deletions
|
|
@ -262,21 +262,28 @@ body {
|
|||
}
|
||||
|
||||
.legend-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 2px;
|
||||
border: 1px solid #ffffff;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.legend-icon.light { background: #00bfff; } /* Sky blue for light aircraft */
|
||||
.legend-icon.medium { background: #00ff88; } /* Green for medium aircraft */
|
||||
.legend-icon.large { background: #ff8c00; } /* Orange for large aircraft */
|
||||
.legend-icon.high-vortex { background: #ff4500; } /* Red-orange for high vortex large */
|
||||
.legend-icon.heavy { background: #ff0000; } /* Red for heavy aircraft */
|
||||
.legend-icon.helicopter { background: #ff00ff; } /* Magenta for helicopters */
|
||||
.legend-icon.military { background: #ff4444; } /* Red-orange for military */
|
||||
.legend-icon.ga { background: #ffff00; } /* Yellow for general aviation */
|
||||
.legend-icon.ground { background: #888888; } /* Gray for ground vehicles */
|
||||
.legend-icon svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.legend-icon.light svg { color: #00bfff; } /* Sky blue for light aircraft */
|
||||
.legend-icon.medium svg { color: #00ff88; } /* Green for medium aircraft */
|
||||
.legend-icon.large svg { color: #ff8c00; } /* Orange for large aircraft */
|
||||
.legend-icon.high-vortex svg { color: #ff4500; } /* Red-orange for high vortex large */
|
||||
.legend-icon.heavy svg { color: #ff0000; } /* Red for heavy aircraft */
|
||||
.legend-icon.helicopter svg { color: #ff00ff; } /* Magenta for helicopters */
|
||||
.legend-icon.military svg { color: #ff4444; } /* Red-orange for military */
|
||||
.legend-icon.ga svg { color: #ffff00; } /* Yellow for general aviation */
|
||||
.legend-icon.ground svg { color: #888888; } /* Gray for ground vehicles */
|
||||
|
||||
.table-controls {
|
||||
display: flex;
|
||||
|
|
|
|||
26
assets/static/icons/heavy.svg
Normal file
26
assets/static/icons/heavy.svg
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="36" height="36" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(18,18)">
|
||||
<!-- Heavy aircraft (jumbo jet like A380 or 747) -->
|
||||
<!-- Fuselage (very wide) -->
|
||||
<path d="M0,-16 L-2.5,-14 L-2.5,9 L-1.5,12 L0,13 L1.5,12 L2.5,9 L2.5,-14 Z" fill="currentColor"/>
|
||||
<!-- Main wings (very long and wide) -->
|
||||
<path d="M-2.5,0.5 L-16,4 L-16,6.5 L-2.5,3.5 Z" fill="currentColor"/>
|
||||
<path d="M2.5,0.5 L16,4 L16,6.5 L2.5,3.5 Z" fill="currentColor"/>
|
||||
<!-- Wing tips (large winglets) -->
|
||||
<path d="M-16,4 L-17.5,2.5 L-17.5,5 L-16,6.5 Z" fill="currentColor"/>
|
||||
<path d="M16,4 L17.5,2.5 L17.5,5 L16,6.5 Z" fill="currentColor"/>
|
||||
<!-- Tail wings (large) -->
|
||||
<path d="M-1.2,10 L-7,11.8 L-7,13 L-1.2,11.5 Z" fill="currentColor"/>
|
||||
<path d="M1.2,10 L7,11.8 L7,13 L1.2,11.5 Z" fill="currentColor"/>
|
||||
<!-- Vertical stabilizer (very tall) -->
|
||||
<path d="M0,8 L-0.8,8 L-3,13.5 L0,13.5 L3,13.5 L0.8,8 Z" fill="currentColor"/>
|
||||
<!-- Nose (large) -->
|
||||
<ellipse cx="0" cy="-15" rx="2.5" ry="3" fill="currentColor"/>
|
||||
<!-- Engine nacelles (very large, 4 engines) -->
|
||||
<ellipse cx="-6" cy="3" rx="1.5" ry="3" fill="currentColor"/>
|
||||
<ellipse cx="6" cy="3" rx="1.5" ry="3" fill="currentColor"/>
|
||||
<ellipse cx="-4" cy="4" rx="1" ry="2" fill="currentColor"/>
|
||||
<ellipse cx="4" cy="4" rx="1" ry="2" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
24
assets/static/icons/large.svg
Normal file
24
assets/static/icons/large.svg
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="34" height="34" viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(17,17)">
|
||||
<!-- Large aircraft (wide-body airliner) -->
|
||||
<!-- Fuselage (wider than commercial) -->
|
||||
<path d="M0,-15 L-2,-13 L-2,8 L-1.2,11 L0,12 L1.2,11 L2,8 L2,-13 Z" fill="currentColor"/>
|
||||
<!-- Main wings (longer, wider) -->
|
||||
<path d="M-2,0 L-14,3.5 L-14,5.5 L-2,3 Z" fill="currentColor"/>
|
||||
<path d="M2,0 L14,3.5 L14,5.5 L2,3 Z" fill="currentColor"/>
|
||||
<!-- Wing tips (winglets) -->
|
||||
<path d="M-14,3.5 L-15,2.5 L-15,4 L-14,5 Z" fill="currentColor"/>
|
||||
<path d="M14,3.5 L15,2.5 L15,4 L14,5 Z" fill="currentColor"/>
|
||||
<!-- Tail wings -->
|
||||
<path d="M-1,9 L-6,10.5 L-6,11.5 L-1,10.5 Z" fill="currentColor"/>
|
||||
<path d="M1,9 L6,10.5 L6,11.5 L1,10.5 Z" fill="currentColor"/>
|
||||
<!-- Vertical stabilizer (taller) -->
|
||||
<path d="M0,7 L-0.6,7 L-2.5,12 L0,12 L2.5,12 L0.6,7 Z" fill="currentColor"/>
|
||||
<!-- Nose -->
|
||||
<ellipse cx="0" cy="-14" rx="2" ry="2.5" fill="currentColor"/>
|
||||
<!-- Engine nacelles (larger) -->
|
||||
<ellipse cx="-5" cy="2.5" rx="1.2" ry="2.5" fill="currentColor"/>
|
||||
<ellipse cx="5" cy="2.5" rx="1.2" ry="2.5" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
18
assets/static/icons/light.svg
Normal file
18
assets/static/icons/light.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="28" height="28" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(14,14)">
|
||||
<!-- Light aircraft (smaller, simpler design) -->
|
||||
<!-- Fuselage -->
|
||||
<path d="M0,-10 L-1,-9 L-1,5 L-0.5,7 L0,8 L0.5,7 L1,5 L1,-9 Z" fill="currentColor"/>
|
||||
<!-- Main wings -->
|
||||
<path d="M-1,-1 L-8,1 L-8,2.5 L-1,1 Z" fill="currentColor"/>
|
||||
<path d="M1,-1 L8,1 L8,2.5 L1,1 Z" fill="currentColor"/>
|
||||
<!-- Tail wings -->
|
||||
<path d="M-0.5,5 L-3,6 L-3,6.5 L-0.5,6 Z" fill="currentColor"/>
|
||||
<path d="M0.5,5 L3,6 L3,6.5 L0.5,6 Z" fill="currentColor"/>
|
||||
<!-- Vertical stabilizer -->
|
||||
<path d="M0,4 L-0.3,4 L-1,7 L0,7 L1,7 L0.3,4 Z" fill="currentColor"/>
|
||||
<!-- Nose -->
|
||||
<ellipse cx="0" cy="-9.5" rx="1" ry="1.5" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 835 B |
21
assets/static/icons/medium.svg
Normal file
21
assets/static/icons/medium.svg
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(15,15)">
|
||||
<!-- Medium aircraft (medium size, more detailed) -->
|
||||
<!-- Fuselage -->
|
||||
<path d="M0,-12 L-1.2,-11 L-1.2,6 L-0.8,8 L0,9 L0.8,8 L1.2,6 L1.2,-11 Z" fill="currentColor"/>
|
||||
<!-- Main wings -->
|
||||
<path d="M-1.2,-0.5 L-10,2 L-10,3.5 L-1.2,2 Z" fill="currentColor"/>
|
||||
<path d="M1.2,-0.5 L10,2 L10,3.5 L1.2,2 Z" fill="currentColor"/>
|
||||
<!-- Tail wings -->
|
||||
<path d="M-0.7,6.5 L-4,7.5 L-4,8.2 L-0.7,7.5 Z" fill="currentColor"/>
|
||||
<path d="M0.7,6.5 L4,7.5 L4,8.2 L0.7,7.5 Z" fill="currentColor"/>
|
||||
<!-- Vertical stabilizer -->
|
||||
<path d="M0,5 L-0.4,5 L-1.5,9 L0,9 L1.5,9 L0.4,5 Z" fill="currentColor"/>
|
||||
<!-- Nose -->
|
||||
<ellipse cx="0" cy="-11.5" rx="1.2" ry="1.8" fill="currentColor"/>
|
||||
<!-- Engine nacelles -->
|
||||
<ellipse cx="-3" cy="1.5" rx="0.8" ry="1.5" fill="currentColor"/>
|
||||
<ellipse cx="3" cy="1.5" rx="0.8" ry="1.5" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1 KiB |
|
|
@ -112,37 +112,165 @@
|
|||
<div class="legend">
|
||||
<h4>ADS-B Categories</h4>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon light"></span>
|
||||
<span class="legend-icon light">
|
||||
<svg width="24" height="24" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(14,14)">
|
||||
<path d="M0,-10 L-1,-9 L-1,5 L-0.5,7 L0,8 L0.5,7 L1,5 L1,-9 Z" fill="currentColor"/>
|
||||
<path d="M-1,-1 L-8,1 L-8,2.5 L-1,1 Z" fill="currentColor"/>
|
||||
<path d="M1,-1 L8,1 L8,2.5 L1,1 Z" fill="currentColor"/>
|
||||
<path d="M-0.5,5 L-3,6 L-3,6.5 L-0.5,6 Z" fill="currentColor"/>
|
||||
<path d="M0.5,5 L3,6 L3,6.5 L0.5,6 Z" fill="currentColor"/>
|
||||
<path d="M0,4 L-0.3,4 L-1,7 L0,7 L1,7 L0.3,4 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-9.5" rx="1" ry="1.5" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Light < 7000kg</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon medium"></span>
|
||||
<span class="legend-icon medium">
|
||||
<svg width="24" height="24" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(15,15)">
|
||||
<path d="M0,-12 L-1.2,-11 L-1.2,6 L-0.8,8 L0,9 L0.8,8 L1.2,6 L1.2,-11 Z" fill="currentColor"/>
|
||||
<path d="M-1.2,-0.5 L-10,2 L-10,3.5 L-1.2,2 Z" fill="currentColor"/>
|
||||
<path d="M1.2,-0.5 L10,2 L10,3.5 L1.2,2 Z" fill="currentColor"/>
|
||||
<path d="M-0.7,6.5 L-4,7.5 L-4,8.2 L-0.7,7.5 Z" fill="currentColor"/>
|
||||
<path d="M0.7,6.5 L4,7.5 L4,8.2 L0.7,7.5 Z" fill="currentColor"/>
|
||||
<path d="M0,5 L-0.4,5 L-1.5,9 L0,9 L1.5,9 L0.4,5 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-11.5" rx="1.2" ry="1.8" fill="currentColor"/>
|
||||
<ellipse cx="-3" cy="1.5" rx="0.8" ry="1.5" fill="currentColor"/>
|
||||
<ellipse cx="3" cy="1.5" rx="0.8" ry="1.5" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Medium 7000-34000kg</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon large"></span>
|
||||
<span class="legend-icon large">
|
||||
<svg width="24" height="24" viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(17,17)">
|
||||
<path d="M0,-15 L-2,-13 L-2,8 L-1.2,11 L0,12 L1.2,11 L2,8 L2,-13 Z" fill="currentColor"/>
|
||||
<path d="M-2,0 L-14,3.5 L-14,5.5 L-2,3 Z" fill="currentColor"/>
|
||||
<path d="M2,0 L14,3.5 L14,5.5 L2,3 Z" fill="currentColor"/>
|
||||
<path d="M-14,3.5 L-15,2.5 L-15,4 L-14,5 Z" fill="currentColor"/>
|
||||
<path d="M14,3.5 L15,2.5 L15,4 L14,5 Z" fill="currentColor"/>
|
||||
<path d="M-1,9 L-6,10.5 L-6,11.5 L-1,10.5 Z" fill="currentColor"/>
|
||||
<path d="M1,9 L6,10.5 L6,11.5 L1,10.5 Z" fill="currentColor"/>
|
||||
<path d="M0,7 L-0.6,7 L-2.5,12 L0,12 L2.5,12 L0.6,7 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-14" rx="2" ry="2.5" fill="currentColor"/>
|
||||
<ellipse cx="-5" cy="2.5" rx="1.2" ry="2.5" fill="currentColor"/>
|
||||
<ellipse cx="5" cy="2.5" rx="1.2" ry="2.5" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Large 34000-136000kg</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon high-vortex"></span>
|
||||
<span class="legend-icon high-vortex">
|
||||
<svg width="24" height="24" viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(17,17)">
|
||||
<path d="M0,-15 L-2,-13 L-2,8 L-1.2,11 L0,12 L1.2,11 L2,8 L2,-13 Z" fill="currentColor"/>
|
||||
<path d="M-2,0 L-14,3.5 L-14,5.5 L-2,3 Z" fill="currentColor"/>
|
||||
<path d="M2,0 L14,3.5 L14,5.5 L2,3 Z" fill="currentColor"/>
|
||||
<path d="M-14,3.5 L-15,2.5 L-15,4 L-14,5 Z" fill="currentColor"/>
|
||||
<path d="M14,3.5 L15,2.5 L15,4 L14,5 Z" fill="currentColor"/>
|
||||
<path d="M-1,9 L-6,10.5 L-6,11.5 L-1,10.5 Z" fill="currentColor"/>
|
||||
<path d="M1,9 L6,10.5 L6,11.5 L1,10.5 Z" fill="currentColor"/>
|
||||
<path d="M0,7 L-0.6,7 L-2.5,12 L0,12 L2.5,12 L0.6,7 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-14" rx="2" ry="2.5" fill="currentColor"/>
|
||||
<ellipse cx="-5" cy="2.5" rx="1.2" ry="2.5" fill="currentColor"/>
|
||||
<ellipse cx="5" cy="2.5" rx="1.2" ry="2.5" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>High Vortex Large</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon heavy"></span>
|
||||
<span class="legend-icon heavy">
|
||||
<svg width="24" height="24" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(18,18)">
|
||||
<path d="M0,-16 L-2.5,-14 L-2.5,9 L-1.5,12 L0,13 L1.5,12 L2.5,9 L2.5,-14 Z" fill="currentColor"/>
|
||||
<path d="M-2.5,0.5 L-16,4 L-16,6.5 L-2.5,3.5 Z" fill="currentColor"/>
|
||||
<path d="M2.5,0.5 L16,4 L16,6.5 L2.5,3.5 Z" fill="currentColor"/>
|
||||
<path d="M-16,4 L-17.5,2.5 L-17.5,5 L-16,6.5 Z" fill="currentColor"/>
|
||||
<path d="M16,4 L17.5,2.5 L17.5,5 L16,6.5 Z" fill="currentColor"/>
|
||||
<path d="M-1.2,10 L-7,11.8 L-7,13 L-1.2,11.5 Z" fill="currentColor"/>
|
||||
<path d="M1.2,10 L7,11.8 L7,13 L1.2,11.5 Z" fill="currentColor"/>
|
||||
<path d="M0,8 L-0.8,8 L-3,13.5 L0,13.5 L3,13.5 L0.8,8 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-15" rx="2.5" ry="3" fill="currentColor"/>
|
||||
<ellipse cx="-6" cy="3" rx="1.5" ry="3" fill="currentColor"/>
|
||||
<ellipse cx="6" cy="3" rx="1.5" ry="3" fill="currentColor"/>
|
||||
<ellipse cx="-4" cy="4" rx="1" ry="2" fill="currentColor"/>
|
||||
<ellipse cx="4" cy="4" rx="1" ry="2" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Heavy > 136000kg</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon helicopter"></span>
|
||||
<span class="legend-icon helicopter">
|
||||
<svg width="24" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(16,16)">
|
||||
<path d="M-2,-12 L2,-12 L2,-10 L-2,-10 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-8" rx="2" ry="1" fill="currentColor"/>
|
||||
<path d="M-6,-2 L6,-2 L6,0 L-6,0 Z" fill="currentColor"/>
|
||||
<path d="M-1,-8 L-1,6 L1,6 L1,-8 Z" fill="currentColor"/>
|
||||
<path d="M-3,6 L3,6 L4,8 L-4,8 Z" fill="currentColor"/>
|
||||
<path d="M2,8 L2,10 L4,10 L4,8 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="7" rx="6" ry="1" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Rotorcraft</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon ga"></span>
|
||||
<span class="legend-icon ga">
|
||||
<svg width="24" height="24" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(14,14)">
|
||||
<path d="M0,-8 L-0.8,-7.5 L-0.8,4 L-0.4,5.5 L0,6 L0.4,5.5 L0.8,4 L0.8,-7.5 Z" fill="currentColor"/>
|
||||
<path d="M-0.8,-0.5 L-6,1 L-6,2 L-0.8,1 Z" fill="currentColor"/>
|
||||
<path d="M0.8,-0.5 L6,1 L6,2 L0.8,1 Z" fill="currentColor"/>
|
||||
<path d="M-0.4,4 L-2.5,4.8 L-2.5,5.2 L-0.4,4.8 Z" fill="currentColor"/>
|
||||
<path d="M0.4,4 L2.5,4.8 L2.5,5.2 L0.4,4.8 Z" fill="currentColor"/>
|
||||
<path d="M0,3 L-0.2,3 L-0.8,6 L0,6 L0.8,6 L0.2,3 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-7.5" rx="0.8" ry="1" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Glider/Ultralight</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon ground"></span>
|
||||
<span class="legend-icon ground">
|
||||
<svg width="24" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(16,16)">
|
||||
<path d="M-6,-2 L6,-2 L8,0 L8,2 L-8,2 L-8,0 Z" fill="currentColor"/>
|
||||
<ellipse cx="-4" cy="4" rx="2" ry="2" fill="currentColor"/>
|
||||
<ellipse cx="4" cy="4" rx="2" ry="2" fill="currentColor"/>
|
||||
<path d="M-2,-2 L2,-2 L2,-6 L-2,-6 Z" fill="currentColor"/>
|
||||
<path d="M-1,-6 L1,-6 L1,-8 L-1,-8 Z" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Surface Vehicle</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-icon military">
|
||||
<svg width="24" height="24" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(16,16)">
|
||||
<path d="M0,-14 L-1.2,-12 L-1.2,6 L-0.8,9 L0,10 L0.8,9 L1.2,6 L1.2,-12 Z" fill="currentColor"/>
|
||||
<path d="M-1.2,-1 L-11,2 L-11,3.5 L-1.2,2 Z" fill="currentColor"/>
|
||||
<path d="M1.2,-1 L11,2 L11,3.5 L1.2,2 Z" fill="currentColor"/>
|
||||
<path d="M-0.7,7 L-4.5,8 L-4.5,8.8 L-0.7,8 Z" fill="currentColor"/>
|
||||
<path d="M0.7,7 L4.5,8 L4.5,8.8 L0.7,8 Z" fill="currentColor"/>
|
||||
<path d="M0,5.5 L-0.4,5.5 L-1.8,10 L0,10 L1.8,10 L0.4,5.5 Z" fill="currentColor"/>
|
||||
<ellipse cx="0" cy="-13" rx="1.2" ry="2" fill="currentColor"/>
|
||||
<ellipse cx="-3.5" cy="1.8" rx="0.8" ry="1.8" fill="currentColor"/>
|
||||
<ellipse cx="3.5" cy="1.8" rx="0.8" ry="1.8" fill="currentColor"/>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
<span>Military</span>
|
||||
</div>
|
||||
|
||||
<h4>Sources</h4>
|
||||
<div id="sources-legend"></div>
|
||||
|
|
|
|||
|
|
@ -331,60 +331,48 @@ export class AircraftManager {
|
|||
}
|
||||
|
||||
getAircraftIconType(aircraft) {
|
||||
// For icon selection, we still need basic categories
|
||||
// This determines which SVG shape to use
|
||||
// For icon selection, determine which SVG shape to use based on category
|
||||
if (aircraft.OnGround) return 'ground';
|
||||
|
||||
if (aircraft.Category) {
|
||||
const cat = aircraft.Category.toLowerCase();
|
||||
|
||||
// Map to basic icon types for visual representation
|
||||
// Specialized aircraft types
|
||||
if (cat.includes('helicopter') || cat.includes('rotorcraft')) return 'helicopter';
|
||||
if (cat.includes('military') || cat.includes('fighter') || cat.includes('bomber')) return 'military';
|
||||
if (cat.includes('cargo') || cat.includes('heavy') || cat.includes('super')) return 'cargo';
|
||||
if (cat.includes('light') || cat.includes('glider') || cat.includes('ultralight')) return 'ga';
|
||||
if (cat.includes('glider') || cat.includes('ultralight')) return 'ga';
|
||||
|
||||
// Weight-based categories with specific icons
|
||||
if (cat.includes('light') && cat.includes('7000')) return 'light';
|
||||
if (cat.includes('medium') && cat.includes('7000-34000')) return 'medium';
|
||||
if (cat.includes('large') && cat.includes('34000-136000')) return 'large';
|
||||
if (cat.includes('heavy') && cat.includes('136000')) return 'heavy';
|
||||
if (cat.includes('high vortex')) return 'large'; // Use large icon for high vortex
|
||||
|
||||
// Fallback category matching
|
||||
if (cat.includes('heavy') || cat.includes('super')) return 'heavy';
|
||||
if (cat.includes('large')) return 'large';
|
||||
if (cat.includes('medium')) return 'medium';
|
||||
if (cat.includes('light')) return 'light';
|
||||
}
|
||||
|
||||
// Default commercial icon for everything else
|
||||
return 'commercial';
|
||||
// Default to medium icon for unknown aircraft
|
||||
return 'medium';
|
||||
}
|
||||
|
||||
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')) {
|
||||
return '#00bfff';
|
||||
// Color mapping based on aircraft type/size
|
||||
switch (type) {
|
||||
case 'military': return '#ff4444'; // Red-orange for military
|
||||
case 'helicopter': return '#ff00ff'; // Magenta for helicopters
|
||||
case 'ground': return '#888888'; // Gray for ground vehicles
|
||||
case 'ga': return '#ffff00'; // Yellow for general aviation
|
||||
case 'light': return '#00bfff'; // Sky blue for light aircraft
|
||||
case 'medium': return '#00ff88'; // Green for medium aircraft
|
||||
case 'large': return '#ff8c00'; // Orange for large aircraft
|
||||
case 'heavy': return '#ff0000'; // Red for heavy aircraft
|
||||
default: return '#00ff88'; // Default green for unknown
|
||||
}
|
||||
// Medium aircraft (7000-34000kg) - Green
|
||||
if (cat.includes('medium')) {
|
||||
return '#00ff88';
|
||||
}
|
||||
// High Vortex Large - Red-orange (special wake turbulence category)
|
||||
if (cat.includes('high vortex')) {
|
||||
return '#ff4500';
|
||||
}
|
||||
// Large aircraft (34000-136000kg) - Orange
|
||||
if (cat.includes('large')) {
|
||||
return '#ff8c00';
|
||||
}
|
||||
// Heavy aircraft (> 136000kg) - Red
|
||||
if (cat.includes('heavy') || cat.includes('super')) {
|
||||
return '#ff0000';
|
||||
}
|
||||
}
|
||||
|
||||
// Default to green for unknown commercial aircraft
|
||||
return '#00ff88';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue