From d2e161372c1fa40fa5f3f1caf8710f2847cfe137 Mon Sep 17 00:00:00 2001 From: Sameh Khamis Date: Sat, 14 Nov 2026 01:46:41 -0800 Subject: [PATCH] fix(vessels): the ship the Cockpit rides is no object in view again In-view scanning skipped a vessel whose chevron was hidden and not drawn as its model, which covered the ship the bridge camera rides. It now skipped only vessels past the horizon, so the ridden ship was reported, at the camera's own position. It is skipped again unless its model draws it. --- src/data/aisLiveVessels.test.mjs | 7 +++++++ src/layers/vessels/queries.js | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/src/data/aisLiveVessels.test.mjs b/src/data/aisLiveVessels.test.mjs index a54696878..f082a11ef 100644 --- a/src/data/aisLiveVessels.test.mjs +++ b/src/data/aisLiveVessels.test.mjs @@ -2181,6 +2181,13 @@ test('detection objects name the vessel card their callout gives way to', () => 'vessel:unkeyed:NO MMSI:37.80000:-122.40000', 'the same identity the vessel card is published under', ); + // The ship the bridge camera rides is no object in view. + aisLiveVesselsLayer.setCockpitSubject('200'); + const ids = aisLiveVesselsLayer + .getDetectableObjects() + .map((object) => object.id); + assert.deepEqual(ids, ['NO MMSI']); + aisLiveVesselsLayer.setCockpitSubject(null); } finally { _setVesselStateForTest({ enabled: false }); } diff --git a/src/layers/vessels/queries.js b/src/layers/vessels/queries.js index 4736fc87e..0e98e8c2b 100644 --- a/src/layers/vessels/queries.js +++ b/src/layers/vessels/queries.js @@ -656,6 +656,14 @@ export function createQueries({ const visual = components.rendering.getVisual(record); // Horizon visibility: a vessel drawn as its model still counts. if (!visual.visible) continue; + // The ship the bridge camera rides, its icon hidden, is no object in + // view (drawn as its model, it still counts). + if ( + state.cockpitSubjectId && + record.id === state.cockpitSubjectId && + !visual.modelOwnsVisual + ) + continue; const position = visual.position; if (!position) continue; result.push({