fix(selection): selecting or tracking a contact never recolours it

A tracked aircraft's icon and 3D model keep the colours they have
untracked in Flights and Military Flights (no cyan, no lighter amber);
only the icon's alpha changes (stale fade, clear while its model draws).
A selected vessel or aid keeps its type colour instead of white, and a
tracked satellite's dot keeps its class colour instead of yellow. An
emergency stays red while tracked.
This commit is contained in:
Sameh Khamis committed 2026-11-17 17:49:33 -08:00
1 parent 2f0c01eaa7
commit f49352d228
23 files changed
+192 -108

No files matched your search

+23
View File
@@ -600,6 +600,29 @@ test('an aid to navigation is drawn as the upright buoy, a vessel as its kind’
assert.deepEqual(sail.size, buoy.size);
});
test('selecting a vessel or an aid never changes its colour', async () => {
const aid = {
...observation('993672002'),
mmsi: '993672002',
type: 'Port Hand Mark',
speedMps: 0,
};
const ship = { ...observation('366999004'), type: 'Cargo' };
const { layer, icons } = setup({
async getSnapshot() {
return snapshot([aid, ship]);
},
});
await layer.update();
for (const [id, css] of [
['366999004', VESSEL_KIND_STYLES.cargo.css],
['993672002', AID_TO_NAVIGATION_STYLE.css],
]) {
assert.equal(layer.selectById(id), true);
assert.deepEqual(icons.item(id).color, cssColor(css), id);
}
});
test('a virtual aid to navigation keeps its buoy and its virtual flag', async () => {
const aid = {
...observation('993672009'),