Fly layer focus flights through the camera port

flyToBounds takes an easing, as flyTo does: in the contract, the Cesium
port and the reference recorder, pinned by a new conformance trace.

The flights of radio, awareness, CCTV, submarine cables, cyclones, the
launch preview, installations, ALPR, street-level framing, recent
imagery, weather and world focus now go through the renderer's camera
port. Street-level framing cancels its own flight handle rather than
whatever flight is current. worldFocus.js no longer reaches Cesium and
leaves the allow-list.

Layer pose reads stay for each layer's own slice. The local GeoJSON
flight stays on Cesium: gods-eye-view/infrastructure is used with plain
Cesium viewers that have no renderer bound.
This commit is contained in:
Sameh Khamis committed 2026-11-05 20:46:58 -08:00
1 parent 46a53bb49c
commit c5b716b107
31 files changed
+2349 -871

No files matched your search

+7 -4
View File
@@ -1,3 +1,4 @@
import * as Cesium from 'cesium';
import '../testSupport/registerDom.mjs';
import test from 'node:test';
import assert from 'node:assert/strict';
@@ -15,6 +16,7 @@ import {
response,
settle,
} from '../layers/recentImagery/testDoubles.mjs';
import { bindFakeCesiumCamera } from '../testSupport/fakeCameraPort.mjs';
const S18 = 'S30:2026-09-18';
const L16 = 'L30:2026-09-16';
@@ -128,6 +130,7 @@ function fixture({ fetchImpl, controller = fakeController() } = {}) {
camera: {},
scene: { canvas: { clientWidth: 1000 }, requestRender() {} },
};
bindFakeCesiumCamera(viewer);
layer.init(viewer);
layer.attachMapStackController(controller);
let active = false;
@@ -801,9 +804,7 @@ test('an oversized box offers ZOOM IN in a fixed slot at the end of the notice l
const f = fixture();
const flights = [];
f.viewer.scene.canvas.clientHeight = 500;
f.viewer.scene.ellipsoid = {
cartographicToCartesian: (c) => ({ ...c }),
};
f.viewer.scene.ellipsoid = Cesium.Ellipsoid.WGS84;
Object.assign(f.viewer.camera, {
frustum: { fovy: 2 * Math.atan(Math.tan(Math.PI / 6) / 2) },
flyTo: (options) => flights.push(options),
@@ -835,7 +836,9 @@ test('an oversized box offers ZOOM IN in a fixed slot at the end of the notice l
assert.equal(flights.length, 1);
assert.ok(
Math.abs(
flights[0].destination.height - 400_000 / (2 * Math.tan(Math.PI / 6)),
Cesium.Ellipsoid.WGS84.cartesianToCartographic(flights[0].destination)
.height -
400_000 / (2 * Math.tan(Math.PI / 6)),
) < 1e-6,
);
// Another refusal has nothing to fit; a box that succeeds hides it again.