Repository navigation
fix(geo-layers): remap Web Mercator terrain tiles on GlobeView - #10350
charlieforward9 wants to merge 20 commits into
Conversation
chrisgervang
left a comment
There was a problem hiding this comment.
The fix looks good. Let's consider how to make this generalized for other layers that may need the same correction
This comment has been minimized.
This comment has been minimized.
…or-tiles # Conflicts: # modules/geo-layers/src/terrain-layer/terrain-layer.ts
Done — merged
|
|
@copilot CI hurtin |
… in terrain-layer
Fixed in the latest commit. The CI failures were TypeScript errors introduced during the merge conflict resolution — I incorrectly replaced |
[Medium impact] The PR appears safe to merge, with no new actionable issues found. SummaryThe PR remaps Web Mercator terrain rows for globe views while preserving the loader’s original mesh.
Reviews (7) · Last reviewed commit: "fix(layers): rely on projectionChanged t..." · Reviewed by Greptile |
|
@chrisgervang I revisited this and moved the bitmap fix out of The common quality is not "tile sublayer." It is a layer whose mesh sampling depends on the curved viewport's Terrain keeps its independent Web Mercator row remap in I added a |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Master now picks the BitmapLayer mesh by subdivision step and image coordinates by viewport CRS (#10742, #10874), so this branch keeps that logic and adds only the shouldUpdateState override: a viewport change alone (GlobeView crossing zoom 12) does not flag props, so the mesh and coordinate conversion were never rebuilt for tiles reused across it. GlobeView's resolution now defaults to 0 (no subdivision), so TerrainLayer detects a globe by the viewport CRS's geocentric frame, as SolidPolygonLayer does, instead of by resolution. The BitmapLayer test builds its GlobeViewport with resolution 10, as GlobeView({resolution}) would, and passes image coordinates as 'cartesian' now that COORDINATE_SYSTEM is no longer exported. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The onViewportLoad callback received each tile's [mesh, texture] pair as `arr`. Rename it to `tileContent` so readers can tell what it holds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since #10874, switching between GlobeViewport and WebMercatorViewport sets changeFlags.projectionChanged, which already triggers BitmapLayer's mesh rebuild. The shouldUpdateState override only added an update on every pan and zoom. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Coverage LOD raised its minimum prefetch and placeholder zooms when `viewport.resolution` was set, which used to mean GlobeViewport. Since #10874, `resolution` is a subdivision setting on every View and defaults to 0 in GlobeView, so globes lost the floors and flat views with subdivision gained them. The tests' getter-only `resolution` override also throws now that Viewport assigns the field. Detect globes by the viewport's geocentric target CRS, as #10350 does, and test against a real GlobeViewport. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Under
GlobeView, tiledTerrainLayermeshes come from the loader with rows spaced linearly in latitude, but Web Mercator tile images are spaced in Mercator Y. Imagery and elevation slide north–south within each tile.Change List
TerrainLayer: remap Web Mercator mesh rows to longitude/latitude on globesanycastsBitmapLayer: test rebuilding acrossGlobeView's zoom-12 switchprojectionChangedalready rebuilds the meshprojection-warping.mov
Verified with the tileset-2d, tile-layer, terrain-layer and bitmap-layer headless tests and the terrain-layer, bitmap-layer and mvt-layer render tests.