[geo-layers] Fix TerrainLayer globe Mercator tile warping#10293
Closed
charlieforward9 wants to merge 2 commits into
Closed
[geo-layers] Fix TerrainLayer globe Mercator tile warping#10293charlieforward9 wants to merge 2 commits into
charlieforward9 wants to merge 2 commits into
Conversation
065f81f to
7a58fd4
Compare
7a58fd4 to
6bf36a5
Compare
4 tasks
charlieforward9
commented
May 13, 2026
| meshMaxError, | ||
| signal | ||
| })?.then(mesh => | ||
| viewport.resolution && mesh ? remapMeshToWebMercatorTile(mesh, overlappedBounds) : mesh |
Collaborator
Author
There was a problem hiding this comment.
Unsure how much this costs - seems heavy.
Easier to handle directly in loadTerrain? Gotta check
| }; | ||
| } | ||
|
|
||
| function lngLatToMercatorY(latitude: number): number { |
| const isTileSetURL = (url: string): boolean => | ||
| url.includes('{x}') && (url.includes('{y}') || url.includes('{-y}')); | ||
|
|
||
| function remapMeshToWebMercatorTile(mesh: Mesh, bounds: Bounds): Mesh { |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before
Screen.Recording.2026-02-15.at.6.42.25.PM.mov
Now
No warping
Summary
Fixes TerrainLayer globe rendering for WebMercator terrain tiles by remapping mesh row latitude through inverse WebMercator instead of treating texture rows as linearly spaced latitude.
This addresses the severe continent compression seen near the poles and at far zooms in GlobeView.
Validation
npx vitest run --project headless test/modules/geo-layers/terrain-layer.spec.tsStacked on #10250 /
cr/feat/terrain-layer-globe-grid.