mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Brings the Active Fires intensity work: the FRP filter, the confidence switch, the ember-to-white-hot ramp and the far-zoom heatmap. The filter, switch and ramp work on both engines. The heatmap drapes on Cesium through the layer's Cesium renderer, which also fades the markers across the hand-off; it goes with that renderer on an engine switch and is built again on the next Cesium globe. Navara keeps heat cells for the far bands, now coloured on the FRP ramp.
47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { createLifecycle } from './lifecycle.js';
|
|
|
|
test('reenabling an empty filtered layer never reveals the retained pre-filter heat raster', async () => {
|
|
let shown = false;
|
|
const noop = () => {};
|
|
const layerState = {
|
|
_enabled: false,
|
|
_viewer: {},
|
|
_dataSource: {},
|
|
_fires: [],
|
|
_loading: true,
|
|
_pickIndexById: new Map(),
|
|
// The layer's renderer on the current globe (render/cesium.js).
|
|
_renderer: { setVisible: noop, onEnable: noop },
|
|
_heatImagery: {
|
|
setShow(v) {
|
|
shown = v;
|
|
},
|
|
},
|
|
};
|
|
const lifecycle = createLifecycle({
|
|
layerState,
|
|
services: {
|
|
picking: { registerPickOwner: noop, unregisterPickOwner: noop },
|
|
sprites: { restoreSpriteOrderOnEnable: noop },
|
|
context: { clearSelectedEntityContextForLayer: noop },
|
|
},
|
|
config: { id: 'local-firms', overlayHost: { setVisible: noop } },
|
|
components: {
|
|
rendering: { applyHandoffFade: noop, renderCurrentLod: noop },
|
|
viewport: { installLodWatcher: noop, installMoveEndWatcher: noop },
|
|
selection: { installClickHandler: noop },
|
|
},
|
|
});
|
|
await lifecycle.methods.enable(layerState._viewer);
|
|
assert.equal(
|
|
shown,
|
|
false,
|
|
'empty current set must keep the old raster hidden while refresh is pending',
|
|
);
|
|
layerState._fires = [{ frp: null, confidence: null }];
|
|
await lifecycle.methods.enable(layerState._viewer);
|
|
assert.equal(shown, true, 'nonempty sets still resume their raster');
|
|
});
|