mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Draw aids to navigation as buoys
A buoy, beacon, RACON, light or IALA mark in the vessel feed was drawn as a ship. A vessel record whose type names one, or whose MMSI is an aid-to-navigation station's (99MIDxxxx), is now isAidToNavigation and vesselModelSpec draws it as the fleet set's buoy of its mark (cardinal N/E/S/W, port or starboard hand, safe water, isolated danger, special mark; a red can when the type names no mark), at its built size and flagged fixed so its model does not turn to a heading. Its icon is a disc instead of a chevron. AISStream now subscribes to AidsToNavigationReport by default, and the server names each report's aid type code (0 to 31) as its kind instead of reading it as a ship type.
This commit is contained in:
1 parent
f24abfc88f
commit
279aedb2f4
14 files changed
+345
-14
No files matched your search
@@ -515,3 +515,27 @@ test('AIS feed rows stay keyed by their MMSI', async () => {
|
||||
['235000001', '235000001'],
|
||||
);
|
||||
});
|
||||
|
||||
test('an aid to navigation is drawn as a disc, a vessel as its chevron', async () => {
|
||||
const aid = {
|
||||
...observation('993672001'),
|
||||
mmsi: '993672001',
|
||||
type: 'Port Hand Mark',
|
||||
speedMps: 0,
|
||||
};
|
||||
const ship = { ...observation('366999002'), type: 'Cargo' };
|
||||
const { layer, primitives } = setup({
|
||||
async getSnapshot() {
|
||||
return snapshot([aid, ship]);
|
||||
},
|
||||
});
|
||||
await layer.update();
|
||||
const svgOf = (id) => {
|
||||
const primitive = [...primitives].find((p) => p.id?.id === id);
|
||||
assert.ok(primitive, id);
|
||||
return atob(primitive.image.split(',')[1]);
|
||||
};
|
||||
assert.match(svgOf('993672001'), /<circle/);
|
||||
assert.doesNotMatch(svgOf('993672001'), /<path/);
|
||||
assert.match(svgOf('366999002'), /<path/);
|
||||
});
|
||||
Reference in new issue
Block a user