Find a selected vessel or aircraft again from its card

While a selected vessel, aircraft or military aircraft is off screen, behind
the globe or out of its layer's feed, its Context card shows Find it. One
still in its feed is flown to (an aircraft followed). One out of its feed is
looked up on its own track at the layer's time (the world clock's while the
layer follows it), the card moves to that reading and says how old it is, and
the camera flies there; once the feed has it again its layer selects it again.
With no reading at or before the time the card says so and the camera stays.

A vessel its layer announces is named by its own id, as a click names it,
not by the context store's.
This commit is contained in:
Sameh Khamis committed 2026-11-19 15:40:31 -08:00
1 parent b57d50fe18
commit 22e9c58d84
27 files changed
+833 -22

No files matched your search

+41
View File
@@ -19,6 +19,7 @@ import {
followsClock,
} from './policy.js';
import { emergencyBroadcastPhrase } from '../../data/aircraftEmergency.js';
import { locateOnTrack } from '../../data/locate.js';
export function createQueries({
flightState,
@@ -651,6 +652,46 @@ export function createQueries({
return result;
},
/**
* The track reference of a loaded aircraft, so it can be looked up again
* once it has left the feed (see locate).
* @param {string} icao24
* @returns {string|null}
*/
referenceOf(icao24) {
const id = String(icao24 ?? '')
.trim()
.toLowerCase();
if (!id) return null;
return flightState.records.data.get(id)?.sourceReference ?? id;
},
/**
* Where an aircraft is at the layer's time (the world clock's while the
* layer follows it, else now), from its own track: for an aircraft that
* has left the feed, so it can be found again.
* @param {string} icao24
* @param {{reference?: string, signal?: AbortSignal}} [options]
* @returns {Promise<{status: 'found', lat: number, lon: number,
* altitudeM: ?number, observedAtMs: number}|{status: 'none'}>}
*/
locate(icao24, { reference, signal } = {}) {
const atMs = followsClock(flightState) ? flightState.now() : undefined;
return locateOnTrack(
flightState.feed._source,
reference ??
flightState.records.data.get(
String(icao24 ?? '')
.trim()
.toLowerCase(),
)?.sourceReference ??
String(icao24 ?? '')
.trim()
.toLowerCase(),
{ atMs, signal },
);
},
/**
* Start camera-tracking an aircraft by ICAO hex identifier.
* @param {string} icao24 - ICAO hex identifier of the aircraft.