feat: rebuild airplane tracker with plane icons, fly-to tracking, and path trails
- Create plane SVG billboard icon (top-down airplane silhouette) - Switch aviation plugin from points to billboard type with plane icon - Altitude-colored tinting and heading-based rotation on plane icons - Fly-to camera on entity selection with altitude-aware view distance - Dashed cyan polyline trail behind selected aviation entity - Add hoveredEntity + screen position to Zustand store - Create EntityInfoCard hover tooltip component - Enhanced selection (cyan) vs hover (yellow) highlighting - Cursor changes to pointer on entity hover
This commit is contained in:
1 parent
44b976771e
commit
56e43bb574
7 files changed
+522
-53
No files matched your search
@@ -56,7 +56,6 @@ export class AviationPlugin implements WorldPlugin {
|
||||
}
|
||||
|
||||
async fetch(_timeRange: TimeRange): Promise<GeoEntity[]> {
|
||||
console.log(`[TIME] AviationPlugin.fetch started at ${performance.now()}`);
|
||||
try {
|
||||
const state = useStore.getState();
|
||||
let res;
|
||||
@@ -91,9 +90,7 @@ export class AviationPlugin implements WorldPlugin {
|
||||
};
|
||||
});
|
||||
} else {
|
||||
console.log(`[TIME] AviationPlugin API request starting at ${performance.now()}`);
|
||||
res = await fetch("/api/aviation");
|
||||
console.log(`[TIME] AviationPlugin API request finished at ${performance.now()} with status ${res.status}`);
|
||||
if (!res.ok) throw new Error(`Aviation API returned ${res.status}`);
|
||||
data = await res.json();
|
||||
|
||||
@@ -109,7 +106,6 @@ export class AviationPlugin implements WorldPlugin {
|
||||
|
||||
if (!data.states || !Array.isArray(data.states)) return [];
|
||||
|
||||
console.log(`[TIME] AviationPlugin processing ${data.states.length} states at ${performance.now()}`);
|
||||
const entities = data.states
|
||||
.filter((s: unknown[]) => s[6] !== null && s[5] !== null)
|
||||
.map((s: unknown[]): GeoEntity => {
|
||||
@@ -158,7 +154,6 @@ export class AviationPlugin implements WorldPlugin {
|
||||
},
|
||||
};
|
||||
});
|
||||
console.log(`[TIME] AviationPlugin mapping entities finished at ${performance.now()}`);
|
||||
return entities;
|
||||
} catch (err) {
|
||||
console.error("[AviationPlugin] Fetch error:", err);
|
||||
@@ -181,13 +176,13 @@ export class AviationPlugin implements WorldPlugin {
|
||||
|
||||
renderEntity(entity: GeoEntity): CesiumEntityOptions {
|
||||
const alt = entity.properties.altitude_m as number | null;
|
||||
const isAirborne = !entity.properties.on_ground;
|
||||
return {
|
||||
type: "point",
|
||||
type: "billboard",
|
||||
iconUrl: "/plane-icon.svg",
|
||||
color: altitudeToColor(alt),
|
||||
size: entity.properties.on_ground ? 4 : 6,
|
||||
size: isAirborne ? 8 : 5,
|
||||
rotation: entity.heading,
|
||||
outlineColor: "#000000",
|
||||
outlineWidth: 1,
|
||||
labelText: entity.label || undefined,
|
||||
labelFont: "11px JetBrains Mono, monospace",
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user