From 02c60c0a208328d7fe7da692c9bd5e3d1a966fc7 Mon Sep 17 00:00:00 2001 From: brandonabyrd Date: Wed, 18 Nov 2026 15:42:17 -0600 Subject: [PATCH] fix(cctv): fail open before projection geometry exists --- src/layers/cctv/frames.js | 1 + src/layers/cctv/frames.test.mjs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/layers/cctv/frames.js b/src/layers/cctv/frames.js index d92afd79ec..41c59f0e24 100644 --- a/src/layers/cctv/frames.js +++ b/src/layers/cctv/frames.js @@ -256,6 +256,7 @@ export function createFrames({ state: layerState, services, parts, source }) { const camera = findCamera(viewer); if (typeof camera?.visiblePoints !== 'function') return true; const placed = record?.frustumPositions; + if (!placed) return true; const points = _scratchPoints; points.length = 0; if (record?.position) points.push(record.position); diff --git a/src/layers/cctv/frames.test.mjs b/src/layers/cctv/frames.test.mjs index 2aca236a5e..d2c6b1a6d7 100644 --- a/src/layers/cctv/frames.test.mjs +++ b/src/layers/cctv/frames.test.mjs @@ -448,6 +448,10 @@ test('what cannot be judged counts as visible', () => { const flat = lookingDown(); flat.scene.mode = Cesium.SceneMode.SCENE2D; assert.equal(framesFor(flat).projectionInView(record), true); - const noGeometry = { camera: { id: 'plane' }, projection: record.projection }; + const noGeometry = { + camera: { id: 'plane' }, + projection: record.projection, + position: point(180, 0, 20), + }; assert.equal(framesFor(lookingDown()).projectionInView(noGeometry), true); });