Repository navigation
feat(layers): support custom projections in position-based layers - #10742
Conversation
|
2a5687d to
a1de3e4
Compare
a1de3e4 to
b1f799e
Compare
b1f799e to
9e6bd7c
Compare
9e6bd7c to
ea77bcd
Compare
ea77bcd to
2483bba
Compare
2483bba to
38ec0c2
Compare
ibgreen
left a comment
There was a problem hiding this comment.
API and fundamental functionality review of this revision. The source-space preparation → projection → tessellation flow is a useful foundation. I found four integration issues below to address before approval, particularly for binary geometry and the documented Cartesian bypass. This review is based on source and existing-test inspection; I have not run the tests.
|
Thanks Xiaoji — the broader layer integration makes this stack much more useful. Preparing geometry in source space, projecting the generated vertices, then correcting polygon winding and triangulating is a good foundation. The Albers GeoJSON render cases, including Alaska, are valuable coverage. A few API/directional observations alongside the four inline correctness comments:
These broader ideas can be follow-ups. For this PR, I would address the inline issues around WebGPU binary polygons, longitude wrapping, Cartesian mesh transforms, and coordinate-system changes before approval. This is a source review; I have not run the tests. |
38ec0c2 to
0581426
Compare
0581426 to
c466aca
Compare
c466aca to
be34ebc
Compare
Comments Outside DiffThese findings could not be posted inline.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit be34ebc. Configure here.
Master now picks the BitmapLayer mesh by subdivision step and image coordinates by viewport CRS (#10742, #10874), so this branch keeps that logic and adds only the shouldUpdateState override: a viewport change alone (GlobeView crossing zoom 12) does not flag props, so the mesh and coordinate conversion were never rebuilt for tiles reused across it. GlobeView's resolution now defaults to 0 (no subdivision), so TerrainLayer detects a globe by the viewport CRS's geocentric frame, as SolidPolygonLayer does, instead of by resolution. The BitmapLayer test builds its GlobeViewport with resolution 10, as GlobeView({resolution}) would, and passes image coordinates as 'cartesian' now that COORDINATE_SYSTEM is no longer exported. Co-Authored-By: Claude Opus 5.5 <[email protected]>

For #10739 (PR 3 of 6)
Connect position-based layers to the custom projection infrastructure.
Changed list
Note
Medium Risk
Touches core attribute projection and tessellation paths across many layers; behavior changes for custom projections and wrapLongitude, though standard MapView paths are largely unchanged when transforms are off.
Overview
Extends experimental
CustomProjectionViewsupport to most position-driven layers by wiringusePositionTransforms()into scatterplots, lines/arcs, paths, polygons, icons, text, columns, grid cells, point clouds, bitmaps, and instanced mesh layers.Geometry pipelines now subdivide and normalize in input CRS, then apply the viewport projection once per vertex. Path and polygon tessellators retessellate on projection, coordinate-system, and
modelMatrixchanges without mutating source data.wrapLongitudeand great-circle shortest-path behavior are disabled when the viewport preprojects;BitmapLayerprojects a subdivided mesh and skips geographic image-coordinate uniforms in that mode.Docs and release notes broaden the supported layer list and document bitmap meshing, great-circle, and longitude-wrap limits. Tests cover transform invalidation, WebGPU paths, EPSG:5070 US-states GeoJSON render goldens (WebGL/WebGPU), and a checked-in states fixture.
Reviewed by Cursor Bugbot for commit be34ebc. Bugbot is set up for automated code reviews on this repo. Configure here.