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({