feat(firms): a marker stand-in can set how far the camera stands from a fire it draws (#1832)

setMarkerStandIn takes an optional focusRangeM(record): when a click on a fire the stand-in draws moves the camera there, it stands off that many metres instead of the usual fire framing. A world focus request may carry its own rangeM; past the framed radius it replaces the kind's range.
This commit is contained in:
Sameh Khamis authored and GitHub committed 2026-11-18 17:46:31 -08:00
1 parent 0a9235cc69
commit cd144ecad5
6 files changed
+63 -3

No files matched your search

+19
View File
@@ -206,6 +206,25 @@ test('fires frame wider than vessels — a fire is read by its surroundings', ()
);
});
test("a target's own range stands the camera off that far, past the framed radius", () => {
const range = (rangeM) => {
const camera = stubCamera();
flyToWorldTarget(bindFakeCesiumCamera({ camera }), {
kind: 'fire',
id: 'fire-1',
position: POSITION,
rangeM,
});
const { sphere, options } = camera.calls.flights[0];
assert.equal(sphere.radius, WORLD_FOCUS_FRAMING.fire.radiusM);
return options.offset.range;
};
assert.equal(range(24_000), 24_000);
// Inside the framed sphere, or not a number: the kind's own range.
for (const value of [WORLD_FOCUS_FRAMING.fire.radiusM, 0, -5, NaN, '9000'])
assert.equal(range(value), WORLD_FOCUS_FRAMING.fire.rangeM);
});
test('every framing is a real oblique standoff, not a nadir or an inside-out sphere', () => {
const kinds = Object.keys(WORLD_FOCUS_FRAMING);
assert.deepEqual(kinds.sort(), [