Ask the renderer's query port for heights through the queries gateway

The Cesium scene's height service moves into the Cesium adapter
(src/render/cesium/heights.js), where the Cesium query port answers its
height members through it; the files still bound to the Cesium scene
import it from there.

src/queries/heights.js becomes the height gateway over the renderer's
query port: heightsOf(viewer) answers now, clampNow, batch, clampBatch and
supported as before, a miss is null, a failed or destroyed query rejects,
and exclusions are draw set ids. The source scan that keeps height queries
in one place still holds: outside the renderer, only the gateway asks for
streamed heights. The bikeshare layer samples its station heights through
it.

Heights leaves the allow-list.
This commit is contained in:
Sameh Khamis committed 2026-11-07 04:13:18 -08:00
1 parent 3abb05ec4b
commit e34e923ddd
22 files changed
+665 -248

No files matched your search

+4 -4
View File
@@ -14,7 +14,7 @@ import {
POINT_FADE_BY_DISTANCE,
POINT_DISABLE_DEPTH_TEST_M,
} from './policy.js';
import { heightsFor } from '../../queries/heights.js';
import { heightsOf } from '../../queries/heights.js';
import { fromDegrees } from '../../geo/ellipsoid.js';
import { drawOf } from '../../render/rendererOf.js';
@@ -175,9 +175,9 @@ export function createRendering({
let height = POINT_HEIGHT_OFFSET_M;
// Sample terrain height so points sit on ground rather than at ellipsoid level
const scene = layerState._viewer?.scene;
if (scene?.sampleHeightSupported) {
const sampled = heightsFor(scene).now({ lon, lat });
const viewer = layerState._viewer;
if (viewer && heightsOf(viewer).supported().surface) {
const sampled = heightsOf(viewer).now({ lon, lat });
if (sampled !== null) height = sampled + POINT_HEIGHT_OFFSET_M;
}
+1 -1
View File
@@ -1,7 +1,7 @@
import { phaseTiming } from '../../sources/phaseTiming.js';
import * as Cesium from 'cesium';
import { DOT_HEIGHT_OFFSET, MAX_WAYPOINTS_PER_ROAD } from './policy.js';
import { heightsFor } from '../../queries/heights.js';
import { heightsFor } from '../../render/cesium/heights.js';
function surfaceTilesReady(scene) {
if (scene.globe?.show) return scene.globe.tilesLoaded !== false;
+1 -1
View File
@@ -7,7 +7,7 @@ import {
HEIGHT_SAMPLE_MAX_ALTITUDE_M,
withinViewBounds,
} from './policy.js';
import { heightsFor } from '../../queries/heights.js';
import { heightsFor } from '../../render/cesium/heights.js';
/** Surface preparation off the render path, shared by markers and history. */
export function createHeight({ state, services, parts }) {