Skip to content

[geo-layers] Fix GlobeView Mercator tile warping#10350

Open
charlieforward9 wants to merge 5 commits into
masterfrom
cr/fix-globe-mercator-tiles
Open

[geo-layers] Fix GlobeView Mercator tile warping#10350
charlieforward9 wants to merge 5 commits into
masterfrom
cr/fix-globe-mercator-tiles

Conversation

@charlieforward9

@charlieforward9 charlieforward9 commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes GlobeView rendering 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 tiled GlobeView mesh row latitude through @math.gl/web-mercator during the private terrain load path.
  • TerrainLayer: keeps the remap scoped to tiled GlobeView and copies the position array so loader/cached mesh data is not mutated.
  • TileLayer: defaults generated BitmapLayer tile imagery to WebMercator image coordinates in GlobeView while preserving explicit _imageCoordinateSystem overrides.
  • Tests cover terrain row remapping, source mesh integrity, default GlobeView bitmap coordinates, and explicit bitmap coordinate preservation.

Validation

  • yarn vitest run --project headless test/modules/geo-layers/terrain-layer.spec.ts
  • yarn vitest run --project headless test/modules/geo-layers/tile-layer/tile-layer.spec.ts
  • Pre-commit hook ran lint/format/node smoke tests during commit; only existing warnings were reported.

Visual Validation

projection-warping.mov

@coveralls

coveralls commented Jun 6, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 83.402% (+0.01%) from 83.39% — cr/fix-globe-mercator-tiles into master

@chrisgervang chrisgervang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good. Let's consider how to make this generalized for other layers that may need the same correction

Comment thread modules/geo-layers/src/terrain-layer/terrain-layer.ts Outdated
Comment thread modules/geo-layers/src/tile-layer/tile-layer.ts
private _getGlobeBitmapLayerProps(layer: Layer): Record<string, unknown> | null {
if (
!(this.context.viewport instanceof _GlobeViewport) ||
!(layer instanceof BitmapLayer) ||

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@chrisgervang chrisgervang mentioned this pull request Jun 11, 2026
53 tasks
@chrisgervang chrisgervang added this to the v9.4 milestone Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants