refactor: supply application catalogs explicitly

This commit is contained in:
Sameh Khamis committed 2026-09-14 13:56:51 -07:00
1 parent fad93f22f8
commit c3de679c61
16 files changed
+288 -50

No files matched your search

+9 -2
View File
@@ -1,3 +1,4 @@
import { createStandaloneCatalog } from './catalog.js';
import { createStandalonePlaceSearch } from './placeSearch.js';
import { createApplication } from '../app/application.js';
import { createStandaloneScene } from './scene.js';
@@ -22,6 +23,7 @@ export function createStandaloneApplication({
const loadingScreen = document.getElementById('loading-screen');
const loaderStatus = loadingScreen.querySelector('.loader-status');
let placeSearch;
const catalog = createStandaloneCatalog();
return createApplication({
createScene: (context) => {
placeSearch = createStandalonePlaceSearch({
@@ -37,9 +39,14 @@ export function createStandaloneApplication({
});
},
createControls: (context) =>
createStandaloneControls({ ...context, loaderStatus, placeSearch }),
createStandaloneControls({
...context,
loaderStatus,
placeSearch,
catalog,
}),
createData: (context) =>
createStandaloneData({ ...context, allowQaRegistration }),
createStandaloneData({ ...context, allowQaRegistration, catalog }),
createTools: (context) =>
createStandaloneTools({ ...context, loadingScreen, placeSearch, voice }),
});
+40
View File
@@ -0,0 +1,40 @@
import flightsLayer from '../data/flights.js';
import militaryFlightsLayer from '../data/militaryFlights.js';
import alprCamerasLayer from '../data/alprCameras.js';
import earthquakesLayer from '../data/earthquakes.js';
import satellitesLayer from '../data/satellites.js';
import rocketLaunchesLayer from '../data/rocketLaunches.js';
import trafficLayer from '../data/traffic.js';
import cctvLayer from '../data/cctv.js';
import radioLayer from '../data/radio.js';
import bikeshareLayer from '../data/bikeshare.js';
import aisLiveVesselsLayer from '../data/aisLiveVessels.js';
import militaryInstallationsLayer from '../data/militaryInstallations.js';
import militaryAwarenessLayer from '../data/militaryAwareness.js';
import localDataLayers from '../data/localLayers.js';
import { LAYER_STATE_REGISTRY } from '../data/layerState.js';
import { createLayerCatalog } from '../app/catalog.js';
/** Select the existing standalone instances and current persistence schema. */
export function createStandaloneCatalog() {
return createLayerCatalog(
[
flightsLayer,
militaryFlightsLayer,
earthquakesLayer,
alprCamerasLayer,
satellitesLayer,
rocketLaunchesLayer,
trafficLayer,
cctvLayer,
radioLayer,
bikeshareLayer,
aisLiveVesselsLayer,
militaryInstallationsLayer,
militaryAwarenessLayer,
...localDataLayers,
],
LAYER_STATE_REGISTRY,
);
}
+8 -1
View File
@@ -1 +1,8 @@
export { createApplicationControls as createStandaloneControls } from '../app/controls.js';
import { createApplicationControls } from '../app/controls.js';
import { createStandaloneCatalog } from './catalog.js';
export function createStandaloneControls(options) {
return createApplicationControls({
catalog: createStandaloneCatalog(),
...options,
});
}
+8 -1
View File
@@ -1 +1,8 @@
export { createApplicationData as createStandaloneData } from '../app/data.js';
import { createApplicationData } from '../app/data.js';
import { createStandaloneCatalog } from './catalog.js';
export function createStandaloneData(options) {
return createApplicationData({
catalog: createStandaloneCatalog(),
...options,
});
}