mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
refactor: own application request operations and surface caches
This commit is contained in:
1 parent
310809e8f1
commit
ac977bd8bc
53 files changed
+4388
-3317
No files matched your search
@@ -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({
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user