Keep Contacts, active layer intents and mapped sites across globe switches

This commit is contained in:
German Khokhlov committed 2026-11-03 03:05:47 +04:00
1 parent 81bcae907f
commit 87bbe14748
35 files changed
+465 -118

No files matched your search

+8 -5
View File
@@ -140,10 +140,12 @@ export function createApplicationCatalog({
),
);
const installations = once(() =>
createApplicationInstallations({
surface,
source: sources.installations,
}),
sessionModel('military-installations', () =>
createApplicationInstallations({
surface,
source: sources.installations,
}),
),
);
const satellites = once(() =>
createApplicationSatellites({
@@ -261,13 +263,14 @@ export function createApplicationCatalog({
['military-installations', installations],
[
'military-awareness',
() =>
() => sessionModel('military-awareness', () =>
createApplicationAwareness({
flights: flights(),
military: military(),
vessels: vessels(),
installations: installations(),
}),
),
],
[
'wind',
+2
View File
@@ -21,6 +21,7 @@ export function createApplicationControls({
initialShareCode = null,
localePicker = true,
engineSwitch = false,
layerSession,
}) {
// Initialize the style manager (post-processing, HUD, locations, share links)
const styleManager = new Controls(viewer, {
@@ -42,6 +43,7 @@ export function createApplicationControls({
// A share code to open at start-up instead of the page's address.
initialShareCode,
engineSwitch,
layerSession,
localePicker,
});
defer(() => styleManager.orbitController.stop());
+3 -2
View File
@@ -45,7 +45,7 @@ export function createApplicationData({
onData?.(dataManager);
if (!catalog?.layers || !catalog?.metadata)
throw new TypeError('An application layer catalog is required');
dataManager.bindCatalog(viewer, engine, catalog);
const attached = dataManager.bindCatalog(viewer, engine, catalog);
for (const layer of catalog.layers) layer.attachDataManager?.(dataManager);
for (const layer of catalog.layers)
layer.attachMapStackController?.(mapStackController);
@@ -75,5 +75,6 @@ export function createApplicationData({
// The sonar scene draws on the viewer; the Navara engine has none.
if (viewer) defer(createCyberSonarScene(viewer, dataManager));
return { dataManager, catalog, presentation };
const data = { dataManager, catalog, presentation };
return attached ? attached.then(() => data) : data;
}
+2
View File
@@ -1,3 +1,4 @@
import { rendererFor } from './renderers.js';
import { createAwarenessLayer } from '../../layers/awareness/index.js';
import * as navigation from '../../navigationPolicy.js';
import * as geometry from '../../celestialRing.js';
@@ -17,6 +18,7 @@ export function createApplicationAwareness({
installations,
navigation,
geometry,
renderer: (engine) => rendererFor('military-awareness', engine),
render,
},
});
+1
View File
@@ -60,6 +60,7 @@ test('the Navara mode registers migrated renderers once', async () => {
'recent-imagery',
'ais-live-vessels',
'military-installations',
'military-awareness',
'local-firms',
],
);
+2
View File
@@ -106,6 +106,8 @@ export async function registerNavaraLayerRenderers() {
bikeshare: async () =>
(await import('../layers/bikeshare/render/navara.js'))
.createBikeshareNavaraRenderer,
'military-awareness': async () =>
(await import('../layers/awareness/render/navara.js')).createAwarenessNavaraRenderer,
'military-installations': async () => {
const { createInstallationsNavaraRenderer } =
await import('../layers/installations/render/navara.js');