Application extras come from the renderer plugin; framing, occlusion and panel drawing are contract ports

A renderer plugin may supply applicationHooks(renderer) for what only its
renderer has (map engine, own credits, stale commands, QA handles). What every
renderer should do moves onto the contract: controls.keepEarthFramed (behind
the keepEarthFramed capability), query.occlusionTest (behind occlusionTest),
and panel drawing, which keepPanelRendering now does through resize and
frame.renderNow through the contract. renderNow throws when the frame fails to draw.

The Cesium port installs its zoom-out guard through keepEarthFramed (a setView
no longer cancels its turn) and answers occlusionTest with the scene's probe;
the stub answers it with a horizon test.
This commit is contained in:
Sameh Khamis committed 2026-11-10 21:17:56 -08:00
1 parent a755f63638
commit 619c19ea67
40 files changed
+737 -323

No files matched your search

+4 -5
View File
@@ -1,12 +1,11 @@
/**
* @module render/cesium/zoomOutGuard
* @description Keeps the user's outward zooms bounded and the Earth framed
* on the Cesium camera controller. It reads that controller's own input, so
* it lives in the adapter; the application installs it through the scene's
* viewer hooks (`application.js`).
* on the Cesium camera controller: the camera port's
* `controls.keepEarthFramed` (`cameraControls.js`). It reads that
* controller's own input, so it lives in the adapter.
*/
import * as Cesium from 'cesium';
import { governorRequestRender } from '../../renderGovernor.js';
import { cameraFlightActive } from './internals.js';
/** Whole-Earth input limit; explicit camera destinations can go farther. */
@@ -87,7 +86,7 @@ function readInput(aggregator, bindings) {
export function installZoomOutGuard(
viewer,
{
requestRender = governorRequestRender,
requestRender = () => viewer?.scene?.requestRender?.(),
subscribeCameraHandoff,
createAggregator = (canvas) => new Cesium.CameraEventAggregator(canvas),
} = {},