Read the navigation and point-and-ask camera through the renderer's ports

The navigation controller and the location navigation cancel flights and
read the camera's place through the camera port. Point-and-ask's camera
pose key and its "around here" radius read the camera port's pose; its
entity pick moves into the input dispatcher (pickAt), which picks as a
click does, so the follow's helper still reads as its target.

navigationController, locationNavigation and pointerPick leave the Cesium
allow-list. Their package entries (./ui/navigation and three voice
entries) no longer load the Cesium adapter: given a viewer of a
caller's own, they find its camera once the caller loads
./render/cesium/unbound. They are listed as such in the unbound camera
test, which fails if one starts loading the factory again.
This commit is contained in:
Sameh Khamis committed 2026-11-07 03:11:51 -08:00
1 parent 3484bfa56d
commit a2c4d27b5a
9 files changed
+92 -35

No files matched your search

+9 -6
View File
@@ -1,6 +1,5 @@
import { findCamera } from '../render/cesium/camera.js';
import { findCamera } from '../render/rendererOf.js';
import { stopFollowing } from '../data/followed.js';
import * as Cesium from 'cesium';
import { t } from '../i18n/index.js';
import { createStateChannel } from '../app/stateChannel.js';
import { LocationControls } from './location.js';
@@ -387,15 +386,19 @@ export class LocationNavigation {
settled = true;
clearTimeout(timer);
this._endWorldJumpTransition();
const carto = this.viewer.camera.positionCartographic;
const pose = findCamera(this.viewer)?.pose();
const result = {
ok: !cancelled,
action: 'zoom_to_globe',
cancelled,
heightKm: Math.round(GLOBE_VIEW.heightM / 1000),
centeredOn: {
latitude: Number(Cesium.Math.toDegrees(carto.latitude).toFixed(2)),
longitude: Number(Cesium.Math.toDegrees(carto.longitude).toFixed(2)),
latitude: Number.isFinite(pose?.lat)
? Number(pose.lat.toFixed(2))
: null,
longitude: Number.isFinite(pose?.lon)
? Number(pose.lon.toFixed(2))
: null,
},
};
this._publishGlobeResetting?.(false);
@@ -405,7 +408,7 @@ export class LocationNavigation {
};
this._cancelGlobeReset = () => finish(true);
timer = window.setTimeout(() => {
const height = this.viewer.camera.positionCartographic?.height;
const height = findCamera(this.viewer)?.pose().height;
finish(
!Number.isFinite(height) ||
Math.abs(height - GLOBE_VIEW.heightM) > 1000,