Add depth-classified earthquakes on Navara

Match native ground footprints, encoded alpha and source ordering on real terrain and photoreal tiles while excluding forward meshes. Cache static screen data and reduce large-disc edge work without changing GPU pixels.

Add deterministic lifecycle, source/share, foreground/horizon and three-context performance proof; restore credits for available Navara feeds and retain failure history in migration evidence.
This commit is contained in:
German Khokhlov committed 2026-10-27 13:42:07 +04:00
1 parent c89185f352
commit a3152ab719
14 files changed
+1106 -16

No files matched your search

+2
View File
@@ -24,6 +24,7 @@ test('the Navara mode registers the aircraft layers’ and vessels’ renderers,
'rocket-launches',
'satellites',
'ais-live-vessels',
'earthquakes',
])
assert.equal(layerAvailableOn(id, 'navara'), true, id);
assert.deepEqual(
@@ -34,6 +35,7 @@ test('the Navara mode registers the aircraft layers’ and vessels’ renderers,
'flights',
'military',
'local-adsb',
'earthquakes',
'satellites',
'rocket-launches',
'ais-live-vessels',
+25 -8
View File
@@ -41,15 +41,18 @@ export function navaraModeNotice(availability) {
});
}
/**
* Data credits for what the shell uses without data layers: place search,
* its OpenStreetMap data and the keyless terrain. Navara lists every credit
* in one attribution card, so layer credits would only crowd it.
*/
const SHELL_CREDIT_KEYS = new Set([
/** Static attribution for the shell and the layers available on Navara. */
const NAVARA_CREDIT_KEYS = new Set([
'photon-geocoder',
'openstreetmap',
'reearth-terrain',
'opensky',
'adsblol',
'adsbdb',
'aisstream',
'celestrak',
'launch-library-2',
'usgs',
]);
/**
@@ -58,6 +61,15 @@ const SHELL_CREDIT_KEYS = new Set([
*/
export async function registerNavaraLayerRenderers() {
const loaders = {
earthquakes: async () => {
const { createEarthquakesNavaraRenderer } =
await import('../layers/earthquakes/render/navara.js');
return (engine, options) =>
createEarthquakesNavaraRenderer(engine, {
...options,
...navaraViews.get(engine),
});
},
'rocket-launches': async () => {
const { createLaunchesNavaraRenderer } =
await import('../layers/launches/render/navara.js');
@@ -124,7 +136,12 @@ export async function createNavaraScene({
});
defer(() => globe.destroy());
const { engine } = globe;
navaraViews.set(engine, { view: globe.view, MeshDesc: globe.MeshDesc });
navaraViews.set(engine, {
view: globe.view,
MeshDesc: globe.MeshDesc,
EffectDesc: globe.EffectDesc,
NavaraEffect: globe.NavaraEffect,
});
defer(() => navaraViews.delete(engine));
// The layers drawn on Navara (their render/navara.js), before the catalog
// asks the registry which layers this engine shows.
@@ -155,7 +172,7 @@ export async function createNavaraScene({
// Navara's attribution card.
registerDataCredits(
engine,
(credits ?? DATA_CREDITS).filter(({ key }) => SHELL_CREDIT_KEYS.has(key)),
(credits ?? DATA_CREDITS).filter(({ key }) => NAVARA_CREDIT_KEYS.has(key)),
);
return {
viewer: null,
+26 -3
View File
@@ -131,11 +131,11 @@ test('the Navara scene builds the engine on the app container and no viewer', as
assert.equal(run.loads[0].search, '?engine=navara&look=photoreal');
assert.ok(run.scene.operations.searchAndFlyTo);
assert.equal(globalThis.window.__GOOGLE_MAPS_API_KEY__, 'google-test');
// Data layers are off: only the credits of what the shell itself uses
// (place search, its OSM data, keyless terrain) go to the engine's credits.
// Match the native static attribution policy for available data layers,
// even before a layer is enabled.
assert.deepEqual(
run.engine.fake.credits.map(({ html }) => html),
['Search credit', 'OSM credit', 'Terrain credit'],
['Flights credit', 'Search credit', 'OSM credit', 'Terrain credit'],
);
});
@@ -171,3 +171,26 @@ test('the Navara scene tears down the controller, then the globe', async (t) =>
assert.equal(isRenderGovernorInstalled(run.engine), false);
assert.equal(view.__GOOGLE_MAPS_API_KEY__, undefined);
});
test('Navara keeps attribution for every available W1/W2 source and excludes unavailable data', async (t) => {
const keys = [
'opensky',
'adsblol',
'adsbdb',
'aisstream',
'celestrak',
'launch-library-2',
'usgs',
'photon-geocoder',
'openstreetmap',
'reearth-terrain',
];
const run = await startScene({
credits: [...keys, 'firms'].map((key) => ({ key, html: `Credit ${key}` })),
});
t.after(run.teardown);
assert.deepEqual(
run.engine.fake.credits.map(({ html }) => html),
keys.map((key) => `Credit ${key}`),
);
});