Skip to content

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

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

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

Conversation

@charlieforward9
Copy link
Copy Markdown
Collaborator

@charlieforward9 charlieforward9 commented Jun 6, 2026

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
Copy link
Copy Markdown

coveralls commented Jun 6, 2026

Coverage Status

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

Copy link
Copy Markdown
Collaborator

@chrisgervang chrisgervang left a comment

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

meshMaxError,
signal
});
const isGlobe = Boolean(viewport.resolution && viewport.resolution > 0);
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.

Is this the best way to detect globe?

});
}

private _getGlobeBitmapLayerProps(layer: Layer): Record<string, unknown> | null {
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.

Is this the best way to detect this? It works for bitmap layer but not for any custom layers extending bitmap layer.

How would custom layers take advantage?

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