refactor(earthquakes): extract native renderer with identical ground-disc output

Keep refresh, cancellation and label policy engine-neutral; inject the original native entities at composition. Prove static geometry, analyst records, owner disposal and last-good refresh behavior. Native dev and QA-preview pass 18 checks each; all eight baseline PNGs remain byte-identical.
This commit is contained in:
German Khokhlov committed 2026-10-27 10:56:41 +04:00
1 parent e8870a4766
commit c89185f352
13 files changed
+343 -92

No files matched your search

+12 -2
View File
@@ -1,6 +1,16 @@
import { rendererFor } from './renderers.js';
import { createEarthquakesCesiumRenderer } from '../../layers/earthquakes/render/cesium.js';
import { createEarthquakesLayer } from '../../layers/earthquakes/index.js';
import { overlayHost } from './overlayHost.js';
/** Wire earthquake observations to the application overlay host. */
export function createApplicationEarthquakes(options) {
return createEarthquakesLayer({ overlayHost, ...options });
export function createApplicationEarthquakes({
renderer = {
create: ({ engine = null, ...options }) =>
engine
? rendererFor('earthquakes', engine, options)
: createEarthquakesCesiumRenderer(null, options),
},
...options
} = {}) {
return createEarthquakesLayer({ overlayHost, renderer, ...options });
}
+2
View File
@@ -1,3 +1,4 @@
import { createEarthquakesCesiumRenderer } from '../../layers/earthquakes/render/cesium.js';
import { createLaunchesCesiumRenderer } from '../../layers/launches/render/cesium.js';
// Which engine draws which layer: the layer renderer registry (plan, "layer
// renderer interface") and the layer availability API built on it.
@@ -89,6 +90,7 @@ export const layerAvailableOn = (layerId, engineKind) =>
/** Cesium renderers extracted from their layers (render/cesium.js). */
export const CESIUM_LAYER_RENDERERS = Object.freeze({
earthquakes: createEarthquakesCesiumRenderer,
'rocket-launches': createLaunchesCesiumRenderer,
satellites: createSatellitesCesiumRenderer,
flights: createFlightsCesiumRenderer,
+2 -1
View File
@@ -56,8 +56,9 @@ test('the default registry: every layer on Cesium, none yet on Navara', () => {
}
});
test('the aircraft, vessels, satellites and launches have extracted Cesium renderers; the others still draw themselves', () => {
test('the aircraft, vessels, satellites, launches and earthquakes have extracted Cesium renderers', () => {
assert.deepEqual(Object.keys(CESIUM_LAYER_RENDERERS), [
'earthquakes',
'rocket-launches',
'satellites',
'flights',