Build the selected vessel's trail without Cesium

Trail vertices are geo/ellipsoid positions and the minimum move is measured
with geo/vector, both giving what the Cesium calls gave. Re-anchoring rows
when the geoid loads asks the rendering part for the anchor, now one
function prepareRecordVisual shares, so icon positions stay Cesium values.
The shared trail renderer takes plain ECEF positions as well, turning them
into Cartesian3s for its polyline; the Cartesian3s other layers hand it
pass through untouched. tracking leaves the Cesium allow-list.
This commit is contained in:
Sameh Khamis committed 2026-11-06 23:02:09 -08:00
1 parent 1c840cb66f
commit e327760074
6 files changed
+224 -26

No files matched your search

+23
View File
@@ -37,3 +37,26 @@ test('trail visibility can change without discarding its accumulated geometry',
trail.destroy();
assert.deepEqual(removed, [added[0]]);
});
test('trail positions may be plain ECEF: the polyline still draws Cartesian3s', () => {
const added = [];
const viewer = {
isDestroyed: () => false,
entities: {
add(definition) {
added.push(definition);
return definition;
},
remove() {},
},
};
const trail = createTrail(viewer, { color: '#ffffff' });
const given = new Cesium.Cartesian3(1, 2, 3);
trail.setPositions([given, { x: 1, y: 2, z: 3.01 }, { x: 4, y: 5, z: 6 }]);
const drawn = added[0].polyline.positions.getValue();
// The near-duplicate merges; a Cartesian3 given passes through as it is.
assert.equal(drawn.length, 2);
assert.equal(drawn[0], given);
assert.ok(drawn[1] instanceof Cesium.Cartesian3);
assert.deepEqual([drawn[1].x, drawn[1].y, drawn[1].z], [4, 5, 6]);
});