[geo-layers] Fix GlobeView Mercator tile warping#10350
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
| private _getGlobeBitmapLayerProps(layer: Layer): Record<string, unknown> | null { | ||
| if ( | ||
| !(this.context.viewport instanceof _GlobeViewport) || | ||
| !(layer instanceof BitmapLayer) || |
There was a problem hiding this comment.
What do BitmapLayers and other layers that need this reprojection have in common?
Have you considered the qualities a layer needs be susceptible to warping?
| bounds: overlappedBounds, | ||
| elevationDecoder, | ||
| meshMaxError, | ||
| remapToWebMercatorTile: isGlobe, |
There was a problem hiding this comment.
All tile sublayers rendered on a globe trigger the remap. Is it true that only the built-in bitmap layer gets modified by this, or would other sublayers get remapped too?
|
@copilot resolver los conflictos de combinación en esta rama. |
…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 |
Summary
Fixes
GlobeViewrendering for WebMercator terrain and imagery tiles. Terrain mesh rows and bitmap UVs now respect WebMercator row spacing instead of treating tile latitude as linear from top to bottom.Why
XYZ/slippy tiles are encoded in WebMercator space. In
GlobeView, deck.gl positions tile geometry in lng/lat space, so using linear latitude rows compresses terrain and imagery toward high latitudes. The distortion is easiest to see at far zooms and pitched globe views.What Changed
TerrainLayer: remaps tiledGlobeViewmesh row latitude through@math.gl/web-mercatorduring the private terrain load path.TerrainLayer: keeps the remap scoped to tiledGlobeViewand copies the position array so loader/cached mesh data is not mutated.TileLayer: defaults generatedBitmapLayertile imagery to WebMercator image coordinates inGlobeViewwhile preserving explicit_imageCoordinateSystemoverrides.GlobeViewbitmap coordinates, and explicit bitmap coordinate preservation.Validation
yarn vitest run --project headless test/modules/geo-layers/terrain-layer.spec.tsyarn vitest run --project headless test/modules/geo-layers/tile-layer/tile-layer.spec.tsVisual Validation
projection-warping.mov