Same-level DEM surface neighbors
Current-epoch, same-level neighbors with matching pixel dimensions now contribute to surface samples. Bilinear weights use four canonical positions; missing tiles renormalize available weights, retaining edge clamping when only the current tile exists. X wraps at the date line; Y never wraps beyond Mercator. Both sides use identical positions, samples and weights, including corners with a missing diagonal neighbor.
map.setTerrain({source: 'dem', exaggeration: 1});
await map.sqs.flush({render: true});
const height = await map.queryTerrainElevation([lng, lat]);
const point = await map.project([lng, lat]);
const ground = await map.unproject(point);
Add an available source first; see DEM layers. demNeighborElevation indicates connected shared sampling. Actual terrain meshes use a uniform33×33 grid. Neighbor arrival/update invalidates mesh and picking caches. Native libraries, WASM, main thread/Worker and desktop share these calculations.
Weighted NoData retains holes and returns null. Loaded high-resolution NoData no longer falls through to a coarser cached height. Different pixel dimensions are not forcibly merged in this stage, and no extra neighbor downloads are added. Original DEM data remains unchanged; exaggeration affects rendered terrain and standard elevation queries. The32MiB geometry budget and64 visible-tile limit remain unchanged.
Same-level surfaces and raw queries improve here. Mixed LOD, different-dimension seams, full level blending, devices and formal releases remain pending. Raw-query level selection and display fallback still follow their available data; this stage is not complete terrain support.
Models cover shared edges, the date line, missing-diagonal corners, old epochs, NoData, the33×33 grid and rebuilding after neighbor updates. The same seven-case native/main-thread/Worker script verifies seam heights, continuity, exaggeration, real-mesh projection roundtrip and red draped pixels. Script, fixture.
Current DEM coverage and query semantics extend cached-child coverage, mixed-region sampling and exact-target takeover. Evidence from this earlier batch remains historical; full LOD blending is still pending.