fix(cctv): count a lone camera in the marker it sits against

A ground cell with one camera always drew its icon, so at some zooms a
camera poked out from under a count marker with its own callout.

An icon closer than the merge gap to a count marker now joins that marker:
the count grows by one and the icon, its callout and its card are not drawn.
Two lone cameras with no count beside them stay two icons, and the active
camera always keeps its own icon.
This commit is contained in:
German Khokhlov committed 2026-11-18 21:23:41 +04:00
1 parent c536d22ff0
commit 65942008bf
8 files changed
+125 -24

No files matched your search

+6 -3
View File
@@ -435,23 +435,26 @@ export function createRendering({
cell.rank = rank;
}
}
// Marks each lone camera that a count marker beside it has taken in.
layerState._counts?.update(visibleCells, project);
for (const cell of visibleCells) {
const record = cell.winner;
picker.push(record);
record.pickerPass = pass;
if (cell.count === 1) {
if (cell.count === 1 && !cell.absorbed) {
record.viewPass = pass;
shown.push(record);
}
}
layerState._counts?.update(visibleCells, project);
const writes = [];
let coverageChanged = false;
let cardsChanged = false;
for (const record of layerState._records) {
const cell = record.viewCell;
record.viewCell = null;
const grouped = Boolean(cell?.winner && cell.count > 1);
const grouped = Boolean(
cell?.winner && (cell.count > 1 || cell.absorbed),
);
if (grouped !== !!record.viewGrouped) {
const id = record.camera.id;
coverageChanged ||= layerState._coverageCohort?.has(id);