[geo-layers] Fix GlobeView Mercator tile warping - #10350
[geo-layers] Fix GlobeView Mercator tile warping#10350charlieforward9 wants to merge 14 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 |
…solution # Conflicts: # test/modules/geo-layers/terrain-layer.spec.ts
Greptile SummaryThe PR corrects GlobeView rendering for Web Mercator terrain and explicitly identified bitmap imagery.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| modules/geo-layers/src/terrain-layer/terrain-layer.ts | Copies tiled terrain positions and remaps mesh-row latitudes through Web Mercator coordinates only for globe rendering. |
| modules/layers/src/bitmap-layer/bitmap-layer.ts | Rebuilds projection-sensitive bitmap mesh and coordinate state when viewport resolution changes. |
| test/modules/geo-layers/terrain-layer.spec.ts | Adds regression coverage for GlobeView terrain-row remapping and verifies that loader-owned mesh data remains unchanged. |
| test/modules/layers/bitmap-layer.spec.ts | Adds coverage for explicit bitmap coordinate conversion and mesh rebuilding across MapView and GlobeView transitions. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Web Mercator tile data] --> B{Layer type}
B -->|Terrain| C[Load terrain mesh]
C --> D[Copy position buffer]
D --> E[Remap UV row spacing to latitude]
E --> F[Render GlobeView mesh]
B -->|Bitmap| G[Read active viewport resolution]
G --> H[Build projection-appropriate mesh]
H --> I[Apply explicit image-coordinate conversion]
I --> J[Render bitmap]
Reviews (4): Last reviewed commit: "refactor(geo-layers): detect curved proj..." | Re-trigger 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. |
Goals
Fix Web Mercator terrain and bitmap warping in curved projections while keeping projection behavior with the layer that owns the mesh and coordinate contract.
Changes
BitmapLayernow rebuilds its mesh and coordinate-conversion uniforms only when the active viewport's mesh resolution changes._imageCoordinateSystem: COORDINATE_SYSTEM.CARTESIANcontract.BitmapLayersubclasses inherit the behavior withoutTileLayertype checks or cloning.TileLayerremains generic: this PR adds noTileLayerprop, projection branch, cache invalidation, or sublayer inspection.TerrainLayerremaps tiled mesh rows from Web Mercator spacing into longitude/latitude for curved projections, while preserving texture coordinates and copying position data rather than mutating loader output.resolutioncapability instead of identifyingGlobeViewportby class.anycasts around nested attributes and bounding boxes.Why this design
The two susceptible data contracts are explicit and layer-owned:
_imageCoordinateSystem.The viewport's mesh
resolutionis the shared rendering capability. Flat views use a six-vertex bitmap quad with no coordinate conversion; curved views tessellate that same bitmap and enable Web Mercator conversion. This keeps custom layers and all otherTileLayersublayers untouched.Validation
yarnBitmapLayer,TerrainLayer, and unchangedTileLayercoverageyarn buildyarn lintyarn test-website(passes with the repository's existing Docusaurus/source-map warnings)010Visual Validation
projection-warping.mov