refactor: own application request operations and surface caches

This commit is contained in:
Sameh Khamis committed 2026-09-14 14:49:04 -07:00
1 parent 310809e8f1
commit ac977bd8bc
53 files changed
+4388 -3317

No files matched your search

+7 -3
View File
@@ -25,19 +25,23 @@ export function createStandaloneApplication({
let placeSearch;
let catalog;
return createApplication({
createScene: (context) => {
catalog = createStandaloneCatalog({ signal: context.signal });
createScene: async (context) => {
placeSearch = createStandalonePlaceSearch({
...geospatial,
resolveApiKey: () => googleApiKey,
signal: context.signal,
});
return createStandaloneScene({
const scene = await createStandaloneScene({
...context,
googleApiKey,
cesiumToken,
loaderStatus,
});
catalog = createStandaloneCatalog({
signal: context.signal,
surface: scene.operations.surface,
});
return scene;
},
createControls: (context) =>
createStandaloneControls({
+7
View File
@@ -1,3 +1,5 @@
import { createSurfaceServices } from '../app/surfaceServices.js';
import { createApplicationRequestServices } from '../services/requests.js';
import { createApplicationCatalog } from '../app/constructCatalog.js';
import { createStandaloneLayerSources } from './layerSources.js';
export { createStandaloneReferenceSources } from './layerSources.js';
@@ -5,8 +7,13 @@ export { createStandaloneReferenceSources } from './layerSources.js';
/** Create fresh layer instances using the existing standalone source choices. */
export function createStandaloneCatalog({
signal = new AbortController().signal,
surface = createSurfaceServices({
terrainSource: createApplicationRequestServices().terrain,
signal,
}),
} = {}) {
return createApplicationCatalog({
surface,
sources: createStandaloneLayerSources(),
signal,
vesselOptions: {
+9 -1
View File
@@ -1 +1,9 @@
export { createApplicationScene as createStandaloneScene } from '../app/scene.js';
import { createApplicationScene } from '../app/scene.js';
import { createApplicationRequestServices } from '../services/requests.js';
/** Supply standalone request services when directly constructing a scene. */
export function createStandaloneScene(options) {
return createApplicationScene({
requestServices: createApplicationRequestServices(),
...options,
});
}