mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(app): construct the globe engine with the viewer
The scene builds the page's Cesium engine right after the viewer (src/app/globeEngine.js), names the startup Google tileset to it once loaded, returns it beside the viewer and destroys it before the viewer. The debug handle exposes it as window.__godsEyeView.engine. Nothing consumes it yet; render holds taken before the governor is installed apply at install. qa-globe-contract now runs on the app's engine (self-built only when the app has none); a throwaway engine checks creation and destroy leave the scene untouched.
This commit is contained in:
1 parent
ab2368f3f3
commit
a5c98c6b07
7 files changed
+141
-2
No files matched your search
+7
-1
@@ -14,6 +14,7 @@ import {
|
||||
governorRequestRender,
|
||||
} from '../renderGovernor.js';
|
||||
import { describeError } from './errors.js';
|
||||
import { createSceneEngine } from './globeEngine.js';
|
||||
|
||||
/** Construct the application globe using the caller's local configuration. */
|
||||
export async function createApplicationScene({
|
||||
@@ -56,6 +57,10 @@ export async function createApplicationScene({
|
||||
uninstallRenderGovernor(viewer);
|
||||
if (!viewer.isDestroyed()) viewer.destroy();
|
||||
});
|
||||
// The globe engine over this viewer; Google's startup tileset is named
|
||||
// once it loads.
|
||||
const tilesetRef = { current: null };
|
||||
const engine = createSceneEngine(viewer, { tilesetRef, defer });
|
||||
defer(installTrackpadPinchZoom(viewer));
|
||||
registerDataCredits(viewer, credits);
|
||||
configureCreditKeyboardAccess(document);
|
||||
@@ -69,6 +74,7 @@ export async function createApplicationScene({
|
||||
cesiumToken,
|
||||
});
|
||||
const tileset = photoreal.tileset;
|
||||
tilesetRef.current = tileset;
|
||||
// A provider can finish after cancellation; retain ownership of its result.
|
||||
defer(() => {
|
||||
if (tileset && !tileset.isDestroyed()) {
|
||||
@@ -121,5 +127,5 @@ export async function createApplicationScene({
|
||||
});
|
||||
|
||||
signal.throwIfAborted();
|
||||
return { viewer, tileset, mapStackController, operations };
|
||||
return { viewer, engine, tileset, mapStackController, operations };
|
||||
}
|
||||
Reference in new issue
Block a user