feat(app): ship terrain on the AWS DEM, with a terrain button and an exaggeration setting - #586
feat(app): ship terrain on the AWS DEM, with a terrain button and an exaggeration setting#586khagele wants to merge 3 commits into
Conversation
…exaggeration setting Terrain was pulled in efiten#247 because the DEM source kept the map loading and froze weak GPUs. efiten#394 decided it comes back on the AWS terrarium tiles, capped at z10, exaggeration 7 by default because the Low Countries show no relief otherwise. This adds the source and a hillshade layer under the signal overlays, a sixth FAB that turns terrain on and off, and the exaggeration steps in Settings with the slope caveat on the control. The mesh waits: hillshade follows the button, setTerrain needs the button, DEM tiles for the view and a 3D view, so a slow host leaves the map flat rather than stalled. Leaving 3D drops the mesh before the tilt back, and entering 3D sets it once the tilt has settled, since easeTo({pitch}) is a no-op under a mesh. Closes efiten#396 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Kasper (2026-09-06): the button is the opt-in, not the opt-out. The loader answers on only for a stored '1'; the hint, the decision log and the release note say so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Kasper (2026-09-06): 3D takes the terrain and the exaggeration along at once, the same rule the map follows in efiten#595. The sixth FAB goes, with its loader, its CSS and its place in the onboarding ring; huntmap's plan reads mode3D as the switch and the map only takes the exaggeration. Settings keeps the exaggeration. Decision log and release note follow. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Master moved: #569, #574, #580, #581 and #589 are merged, master is at Notes below are from reading this PR's diff against master before those merges. Not a full audit, and the green checks are not part of it.
The FAB is added and then removed inside the branch. Net result is the 3D view as the switch, which is the decision. Since merges here are squashed, the commit that lands, and the release note release-please builds from it, will read "with a terrain button and an exaggeration setting".
The DEM cap at z10, the hillshade-follows-geometry ratio and the mesh-off-before-tilt ordering all read as described. The AWS attribution is satisfied: Ordering: this branch's commits, and #588's, are inside #596 and #593. This also touches the same FAB stack offsets in |
Closes #396
The problem
Master has no terrain. #247 pulled it: the DEM source kept the map in a load loop and froze weaker GPUs. #394 decided on 2026-08-21 that it comes back on the AWS terrarium tiles with the exaggeration at 7, adjustable and switchable off, and left one thing open: what the map does when the DEM host is slow. This issue asked for the control; the scope check in the thread makes it carry the terrain too, since no implementation issue existed.
My changes in this PR
app/src/terrain.js: the DEM source (AWS Open Data terrarium, attribution, capped at z10, the low-poly knob measured in spike results: terrain + near-horizontal tilt POC (branch, findings, open decisions) #335), the exaggeration steps 1, 2, 4, 7, 10 with 7 as the default,hillshadeFor(shading tracks the geometry, exaggeration / 10) andterrainPlan: hillshade follows the switch; the mesh needs the switch, DEM tiles for the view and a 3D view. The switch is the 3D view itself (below).app/src/huntmap.js): the source and a hillshade layer under the signal overlays, re-mounted on every style load like the sky;demReadyflips on the firstsourcedatafor the view and resets on a style swap; DEM tile errors are swallowed so the map stays flat rather than stalled.setViewdrops the mesh before the tilt back and sets it after the tilt up has settled, sinceeaseTo({pitch})is a no-op under a mesh (docs/2026-07-11-3d-mode.md). The plan is applied once the overlays are mounted, not onisStyleLoaded(), which stays false while tiles load.docs/2026-09-05-terrain-ships.md, which also records the decide: which terrain elevation source, if any (#293 blocker) #394 decision as that issue asked. Changelog entry in both copies.Verification
parity.test.jswhatsnew.spec.js,--fail-on-flaky-testsNew tests, mutation-checked:
terrainPlangoes red with the tile gate removed and with the 3D gate removed;hillshadeForwith the clamp removed; the settings dot with the exaggeration line removed. The splash test that pins the onboarding ring againstSPLASH_FAB_IDScaught the FAB both on its way in and on its way out.Browser at 780 px with the DEM reachable (first cut, with the button): 2D mounts with the hillshade visible and no mesh; one view tap eases to pitch 60 and the mesh appears at 7 once two DEM tiles are in; back to 2D the mesh goes before the tilt returns to 0. The final cut is verified on the map side in #596 against the same
terrainPlan: 2D flat and unshaded, 3D shaded with the mesh at the Settings exaggeration.idlekeeps firing with terrain in, which the theme switch waits on. Exaggeration 4 from Settings: stored, row active, settings dot on, shading 0.4.Not in this PR, and to check on a phone
web/): feat(web): bring the app's 3D to the map: view button, bars, pillars, buildings, terrain and rotation #596 brings the same terrain to the MapLibre map, on top of this PR.🤖 Generated with Claude Code