Improve aircraft marker visibility
- Increase aircraft marker size from 20px to 24px - Add aircraft wing elements for better aircraft appearance - Use bright green color for aircraft with position data - Add stronger drop shadow for better contrast against map - Gray out aircraft without position data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
5c33bdacd2
commit
35f476211e
2 changed files with 23 additions and 14 deletions
|
|
@ -229,10 +229,9 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.aircraft-marker {
|
.aircraft-marker {
|
||||||
width: 20px;
|
|
||||||
height: 20px;
|
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
filter: drop-shadow(0 0 2px rgba(0,0,0,0.8));
|
filter: drop-shadow(0 0 4px rgba(0,0,0,0.9));
|
||||||
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.aircraft-popup {
|
.aircraft-popup {
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ class SkyView {
|
||||||
if (this.aircraftMarkers.has(aircraft.hex)) {
|
if (this.aircraftMarkers.has(aircraft.hex)) {
|
||||||
const marker = this.aircraftMarkers.get(aircraft.hex);
|
const marker = this.aircraftMarkers.get(aircraft.hex);
|
||||||
marker.setLatLng(pos);
|
marker.setLatLng(pos);
|
||||||
this.updateMarkerRotation(marker, aircraft.track);
|
this.updateMarkerRotation(marker, aircraft.track, aircraft);
|
||||||
this.updatePopupContent(marker, aircraft);
|
this.updatePopupContent(marker, aircraft);
|
||||||
} else {
|
} else {
|
||||||
const marker = this.createAircraftMarker(aircraft, pos);
|
const marker = this.createAircraftMarker(aircraft, pos);
|
||||||
|
|
@ -224,11 +224,14 @@ class SkyView {
|
||||||
}
|
}
|
||||||
|
|
||||||
createAircraftMarker(aircraft, pos) {
|
createAircraftMarker(aircraft, pos) {
|
||||||
|
const hasPosition = aircraft.lat && aircraft.lon;
|
||||||
|
const size = hasPosition ? 24 : 18;
|
||||||
|
|
||||||
const icon = L.divIcon({
|
const icon = L.divIcon({
|
||||||
html: this.getAircraftIcon(aircraft),
|
html: this.getAircraftIcon(aircraft),
|
||||||
className: 'aircraft-marker',
|
className: 'aircraft-marker',
|
||||||
iconSize: [20, 20],
|
iconSize: [size, size],
|
||||||
iconAnchor: [10, 10]
|
iconAnchor: [size/2, size/2]
|
||||||
});
|
});
|
||||||
|
|
||||||
const marker = L.marker(pos, { icon }).addTo(this.map);
|
const marker = L.marker(pos, { icon }).addTo(this.map);
|
||||||
|
|
@ -242,20 +245,27 @@ class SkyView {
|
||||||
|
|
||||||
getAircraftIcon(aircraft) {
|
getAircraftIcon(aircraft) {
|
||||||
const rotation = aircraft.track || 0;
|
const rotation = aircraft.track || 0;
|
||||||
return `<svg width="20" height="20" viewBox="0 0 20 20" style="transform: rotate(${rotation}deg);">
|
const hasPosition = aircraft.lat && aircraft.lon;
|
||||||
<polygon points="10,2 8,18 10,16 12,18" fill="#00a8ff" stroke="#ffffff" stroke-width="1"/>
|
const color = hasPosition ? "#00ff88" : "#888888";
|
||||||
|
const size = hasPosition ? 24 : 18;
|
||||||
|
|
||||||
|
return `<svg width="${size}" height="${size}" viewBox="0 0 24 24" style="transform: rotate(${rotation}deg); filter: drop-shadow(0 0 3px rgba(0,0,0,0.8));">
|
||||||
|
<polygon points="12,2 10,20 12,18 14,20" fill="${color}" stroke="#ffffff" stroke-width="2"/>
|
||||||
|
<polygon points="5,10 12,8 12,12" fill="${color}" stroke="#ffffff" stroke-width="1"/>
|
||||||
|
<polygon points="19,10 12,8 12,12" fill="${color}" stroke="#ffffff" stroke-width="1"/>
|
||||||
</svg>`;
|
</svg>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMarkerRotation(marker, track) {
|
updateMarkerRotation(marker, track, aircraft) {
|
||||||
if (track !== undefined) {
|
if (track !== undefined) {
|
||||||
|
const hasPosition = aircraft.lat && aircraft.lon;
|
||||||
|
const size = hasPosition ? 24 : 18;
|
||||||
|
|
||||||
const icon = L.divIcon({
|
const icon = L.divIcon({
|
||||||
html: `<svg width="20" height="20" viewBox="0 0 20 20" style="transform: rotate(${track}deg);">
|
html: this.getAircraftIcon(aircraft),
|
||||||
<polygon points="10,2 8,18 10,16 12,18" fill="#00a8ff" stroke="#ffffff" stroke-width="1"/>
|
|
||||||
</svg>`,
|
|
||||||
className: 'aircraft-marker',
|
className: 'aircraft-marker',
|
||||||
iconSize: [20, 20],
|
iconSize: [size, size],
|
||||||
iconAnchor: [10, 10]
|
iconAnchor: [size/2, size/2]
|
||||||
});
|
});
|
||||||
marker.setIcon(icon);
|
marker.setIcon(icon);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue