Merge main through #1556 into the renderer seam

Brings in fire intensity and the draped heatmap (#1426), provider labels
(#1521), Rio transit (#1481), chat autocomplete and provider switching
(#1561, #1546) and Cockpit entry by the ridden layer alone (#1556).

What main added that reached Cesium or the viewer:
- The fires heatmap drapes as one image through the globe port's imagery
  (heatImagery.js), above the port's other imagery, and drapes again when
  the map stack's surface changes. The far bands no longer draw heat
  rectangles; the layer's shape set stays as its initialized marker and
  the visibility the context store reads.
- The hand-off between heatmap and markers fades the glow icons' own
  alpha and the icon set's visibility. Markers keep their glows across
  rebuilds; the set culls the horizon itself.
- A double-click on the followed track enters the Cockpit through the
  input dispatcher. The renderer's own double-click follow would let go
  of the track first and cannot be refused from a subscriber, so a press
  on the followed track holds that behaviour off for the press.
- Cockpit entry and the ridden layer read the follow service; the camera
  takes its eye offsets from a profile.
This commit is contained in:
Sameh Khamis committed 2026-11-09 20:52:52 -08:00
commit 823b5dc301
119 files changed
+5782 -577

No files matched your search

-74
View File
@@ -2281,80 +2281,6 @@ test('the GNSS layer draws its cells as ground fills that stay out of the pick p
assert.equal(scene.added.length, 0);
});
test('the fires layer draws its heat cells as ground fills through the Cesium draw port', async (t) => {
const { createFirmsHeatmapLayer } =
await import('../../data/firmsHeatmap.js');
const { fakeInput } = await import('../../input/testDoubles.mjs');
const { bindFakeCesiumScene } =
await import('../../testSupport/fakeCesiumScene.mjs');
const saved = globalThis.window;
globalThis.window = new EventTarget();
const scene = fakeScene();
// Far out, where the layer draws heat cells rather than detections.
const viewer = {
scene,
camera: {
moveEnd: new Cesium.Event(),
positionWC: Cesium.Cartesian3.fromDegrees(-97.7, 30.2, 2e7),
directionWC: new Cesium.Cartesian3(0, 0, -1),
positionCartographic: Cesium.Cartographic.fromDegrees(-97.7, 30.2, 2e7),
},
};
// The real Cesium draw port; camera and frame from the viewer double.
const { unbind } = bindFakeCesiumScene(viewer, { draw: drawOf(viewer) });
const input = fakeInput(viewer);
const raw = (lat, lon, frp) => ({
lat,
lon,
frp,
confidence: 'h',
brightness: 340,
daynight: 'D',
acqDate: '2026-08-03',
acqTime: '0412',
instrument: 'VIIRS',
satellite: 'N20',
});
const layer = createFirmsHeatmapLayer({
id: 'firms',
name: 'FIRMS',
feed: {
getSnapshot: async () => ({
fires: [raw(30.5, -98.2, 1500), raw(-12.1, 131.4, 5)],
fetchedAt: Date.now(),
}),
},
overlayHost: { setEntries() {}, setVisible() {}, clearSource() {} },
});
t.after(() => {
input.destroy();
unbind();
if (saved === undefined) delete globalThis.window;
else globalThis.window = saved;
});
layer.init(viewer);
await layer.enable(viewer);
const all = (host, out = []) => {
out.push(host);
if (host instanceof Cesium.PrimitiveCollection)
for (let i = 0; i < host.length; i++) all(host.get(i), out);
return out;
};
const grounds = () =>
scene.added
.flatMap((host) => all(host))
.filter((p) => p instanceof Cesium.GroundPrimitive);
const instances = grounds().flatMap((g) => g.geometryInstances);
assert.equal(instances.length, 2, 'one fill per cell');
for (const instance of instances) {
assert.ok(instance.geometry instanceof Cesium.RectangleGeometry);
assert.match(instance.id.set, /^firms:\d+:cells$/);
}
assert.equal(grounds()[0].classificationType, Cesium.ClassificationType.BOTH);
layer.destroy(viewer);
assert.equal(grounds().length, 0);
});
test('the context layer draws its static range ring as a haloed line on a viewer of its own', async () => {
const { createRendering } =
await import('../../layers/awareness/rendering.js');
+24
View File
@@ -411,6 +411,30 @@ test('a hold a down subscriber takes keeps its press from selecting', () => {
assert.equal(s.selected.length, 0);
});
test('a hold a down subscriber takes keeps the double-click its press ends in from following', () => {
const s = setup();
let release = null;
// Held from the second press of a double-click, as a tool that takes the
// double-click for itself holds it.
s.port.on('down', () => {
release?.();
release = s.port.behaviours.dblclickFollow.suppress();
});
const doubled = [];
s.port.on('dblclick', (ev) => doubled.push(ev.position));
s.press(5, 6);
s.handler.fire(T.LEFT_DOWN, { position: s.at(5, 6) });
s.handler.fire(T.LEFT_UP, { position: s.at(5, 6) });
s.handler.fire(T.LEFT_CLICK, { position: s.at(5, 6) });
s.handler.fire(T.LEFT_DOUBLE_CLICK, { position: s.at(5, 6) });
assert.equal(doubled.length, 1, 'the subscriber still hears it');
assert.equal(s.followed.length, 0, 'the stock follow does not run');
// Let go, a double-click follows again.
release();
s.handler.fire(T.LEFT_DOUBLE_CLICK, { position: s.at(5, 6) });
assert.equal(s.followed.length, 1);
});
test('not taking the stock, they stay on the viewer’s handler but while held', () => {
const s = setup({ takeStock: false });
const original = s.stockHandler.getInputAction(T.LEFT_CLICK);