Draw no buoy for a virtual aid to navigation

A virtual aid (AIS message 21's VirtualAtoN flag) is a mark broadcast
where nothing physical stands, so drawing it as a buoy showed a mark
that is not there. The vessel source record now carries `virtual`
(false unless a source says true; any source may set it), AISStream
sets it from VirtualAtoN, and the vessel layer keeps such an aid's
disc: vesselModelSpec returns null for it and the layer gathers no
model item for it. Its card, selected card and readout add VIRTUAL
after its kind.
This commit is contained in:
Sameh Khamis committed 2026-11-14 11:07:13 -08:00
1 parent 9ae121c7c0
commit 52507a0755
31 files changed
+160 -18

No files matched your search

+12 -4
View File
@@ -274,8 +274,13 @@ export function createRendering({
);
}
/** The model item for `record`, its spec rebuilt only when its type or size changes. */
/**
* The model item for `record`, its spec rebuilt only when its type or size
* changes; null for a virtual aid to navigation, which keeps its disc: no
* buoy stands there (vesselModelSpec).
*/
function modelItem(record, set) {
if (record.virtual === true) return null;
let item = modelItems.get(record.id);
if (!item || item.record !== record)
item = { record, pickId: record, tint: null, modelOwnsVisual: false };
@@ -309,7 +314,8 @@ export function createRendering({
limitSq
)
continue;
into.set(record.id, modelItem(record, set));
const item = modelItem(record, set);
if (item) into.set(record.id, item);
}
}
@@ -345,8 +351,10 @@ export function createRendering({
gatherModelItems(set, next);
} else {
for (const [id, item] of modelItems)
if (state.records.byId.get(id) === item.record)
next.set(id, modelItem(item.record, set));
if (state.records.byId.get(id) === item.record) {
const kept = modelItem(item.record, set);
if (kept) next.set(id, kept);
}
}
for (const [id, item] of modelItems)
if (next.get(id) !== item) handBackVisual(item.record, occluder);