feat(street-level): place coverage on the bare earth on Google 3D

Draped ground polylines and clamped billboards land on the top of the
Google Photorealistic 3D mesh, so on a street under trees or an overpass
the coverage seemed to float at roof height.

At street zoom on Google 3D (camera below 1,400 m, back above 1,800 m)
the core switches to a `terrain` surface mode. groundCast.js samples the
existing terrain service on the ground-floor grid (0.001 deg), interpolates
bilinearly and adds 2 m; Mapillary lines become plain polylines at those
heights, and cones and the position marker stand on the street, so the
mesh hides what is behind buildings and trees. A tile draws draped first
and swaps to its cast lines once the heights arrive, keeping the old lines
until the new primitives are ready. Lookups are once per tile and aborted
when the tile is dropped; a geoid fallback counts as unknown and leaves
lines draped. Other map stacks and higher views are unchanged.

Providers get getSurface() and groundCaster in their context and an
optional setSurface(mode); getUIState() exposes `surface`. The QA gate
checks draped on Esri and terrain on Google 3D.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Said TurkseverandClaude Opus 5.5 committed 2026-09-28 21:16:54 +01:00
1 parent c7dc3146f2
commit d3d3898dbb
17 files changed
+832 -49

No files matched your search

+64
View File
@@ -517,6 +517,70 @@ async function main() {
await setStack(original);
void stacks;
});
await step(
'coverage sits on the bare earth on Google 3D and drapes elsewhere',
async () => {
const surface = () =>
page.evaluate(() => {
const u = window.__godsEyeView.dataManager.layers
.get('street-level')
.module.getUIState();
return { surface: u.surface, count: u.coverage.count };
});
const setStack = (id) =>
page.evaluate(
(stackId) =>
window.__godsEyeView.mapStackController.setStack(stackId),
id,
);
const original = await page.evaluate(() =>
window.__godsEyeView.mapStackController.getActiveId(),
);
// FOLLOW left the camera at eye height; look down on the city again.
await park();
await sleep(1500);
await setStack('esri-imagery');
await page.waitForFunction(
() =>
window.__godsEyeView.dataManager.layers
.get('street-level')
.module.getUIState().surface === 'draped',
{ timeout: 10_000 },
);
const coverageLoaded = () =>
page.waitForFunction(
() => {
const u = window.__godsEyeView.dataManager.layers
.get('street-level')
.module.getUIState();
return u.coverage.count > 0 && !u.coverage.loading;
},
{ timeout: 60_000 },
);
await coverageLoaded();
assert.equal((await surface()).surface, 'draped', 'draped on Esri');
const photoreal = await page.evaluate(() =>
window.__godsEyeView.mapStackController.isStackAvailable('photoreal'),
);
if (photoreal) {
await setStack('photoreal');
await page.waitForFunction(
() =>
window.__godsEyeView.dataManager.layers
.get('street-level')
.module.getUIState().surface === 'terrain',
{ timeout: 15_000 },
);
await coverageLoaded();
assert.equal((await surface()).surface, 'terrain');
} else {
console.log(
' (Google 3D unavailable here: only the draped path ran)',
);
}
await setStack(original);
},
);
await step(
'EXPAND opens a modal dialog and Esc returns focus to the button',
async () => {