mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Draw the card previews through the renderer, and show vessel photos too
- The route globe, turning model and cockpit view are the renderer's: the Cesium plugin hands them over as its `cardPreviews` application hook (src/render/cesium/cardPreviews.js), and the card's tiles keep only the words, figures and HUD laid over them. Nothing in the UI reaches Cesium, and a renderer without the hook leaves the card its photo and figures. - The turning model is the fleet model the globe draws for the aircraft's type, from the set loaded at startup, so opening a card fetches nothing. The flights layer's record now carries the type code and emitter category that pick it. - The photo comes from the item's own layer: the flights layer's Planespotters photo for the plane it tracks, and the vessels layer's Open Vessel Photos photo for the vessel selected, with its credit. It no longer waits for Contacts to follow the same aircraft. - The satellite models are left out: the card shows a satellite's ground view and graphs its altitude and speed. - The route globe's airport codes are drawn into its own small scene, the compass reads its course in the active language, the callouts no longer speak to screen readers every six seconds, and figures use the app's number format. Esri's tile address and credit live in one place. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
c6bdd38b61
commit
3a0842c103
26 files changed
+1347
-676
No files matched your search
@@ -949,6 +949,36 @@ export function aircraftInsights(record, { nowMs = Date.now() } = {}) {
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* The item's photo, once its layer has looked one up: the tracked airliner's
|
||||
* Planespotters photo, or the selected vessel's Open Vessel Photos photo.
|
||||
* @returns {{src: string, link: string, photographer: string,
|
||||
* licence: string}|null}
|
||||
*/
|
||||
function cardPhoto(dataManager, layerId, record) {
|
||||
let photo = null;
|
||||
try {
|
||||
const layer = dataManager?.layers?.get?.(layerId)?.module;
|
||||
if (layerId === 'ais-live-vessels')
|
||||
photo = layer?.getVesselPhoto?.(text(record?.vesselId));
|
||||
else if (layerId === 'flights') {
|
||||
// Looked up only for the plane the layer tracks.
|
||||
const tracked = layer?.getTrackedSubject?.();
|
||||
if (tracked && text(tracked.id) === text(record?.icao24))
|
||||
photo = tracked.photo;
|
||||
}
|
||||
} catch {
|
||||
photo = null;
|
||||
}
|
||||
if (!text(photo?.src)) return null;
|
||||
return {
|
||||
src: text(photo.src),
|
||||
link: text(photo.link),
|
||||
photographer: text(photo.photographer),
|
||||
licence: text(photo.licence),
|
||||
};
|
||||
}
|
||||
|
||||
export function describeEntity(
|
||||
dataManager,
|
||||
identity,
|
||||
@@ -1024,6 +1054,16 @@ export function describeEntity(
|
||||
warningWords: warnings.map((entry) => entry.words),
|
||||
// For the aircraft card's model and route line.
|
||||
aircraftClass,
|
||||
// What picks the fleet model the globe draws this aircraft with.
|
||||
aircraftModel:
|
||||
kind.kind === 'aircraft' && record
|
||||
? {
|
||||
typeCode: text(record.typeCode ?? record.type) || null,
|
||||
category: record.category ?? null,
|
||||
callsign: text(record.callsign) || null,
|
||||
}
|
||||
: null,
|
||||
photo: cardPhoto(dataManager, layerId, record),
|
||||
// Its class's English name, for the UI to translate; null when unknown.
|
||||
aircraftClassName: AIRCRAFT_CLASS_LABELS[aircraftClass] || null,
|
||||
insights:
|
||||
|
||||
Reference in new issue
Block a user