fix(cockpit): a ship's bridge reads its water from the drawn surface, globe included

The waterline probes read Cesium's scene sample, which takes the globe's
terrain as well as 3D tiles. On the ports they asked for tiles alone,
which hides the globe, so on a globe map a lake or river above sea level
went unread and the eye fell back to the sea. They now ask for the drawn
surface, as before.
This commit is contained in:
Sameh Khamis committed 2026-11-14 00:56:07 -08:00
1 parent 5d48503c51
commit b754418706
2 files changed
+16 -6

No files matched your search

+4 -4
View File
@@ -197,7 +197,9 @@ function vesselSurfaceM(info, nowMs, at = info) {
function readWaterline(read, query, probes, seaM) {
read.inFlight = true;
// An async read: a failure arrives as a rejection, never a throw here.
query.batch(probes, { against: 'tiles' }).then(
// The drawn surface, globe included, as the scene's own sample read it:
// a lake on a globe map stands on its terrain.
query.batch(probes).then(
(samples) => {
if (this.vesselWaterline !== read) return;
read.inFlight = false;
@@ -222,9 +224,7 @@ function readWaterline(read, query, probes, seaM) {
*/
function loadedWaterlineM(query, probes, seaM) {
try {
const heights = probes.map((probe) =>
query.now(probe, { against: 'tiles' }),
);
const heights = probes.map((probe) => query.now(probe));
if (!heights.some(Number.isFinite)) return null;
return vesselWaterlineM(seaM, heights);
} catch {