Repository navigation
feat(core): Viewport classes depend on math.gl projectionEngine - #10872
Pessimistress wants to merge 6 commits into
Conversation
[High impact] Core viewport classes now depend on math.gl projection engine. Update the dependent render case in PR #10874 before merging the renamed option into the stack. Findings
SummaryMoves viewport coordinate conversion and distance scales to math.gl CRS descriptors. The latest changes rename the custom view option to
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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 fd28038. Configure here.
| : PROJECTION_MODE.WEB_MERCATOR_AUTO_OFFSET; | ||
| } | ||
| // A CRS enables CPU conversion; subclasses opt into specialized shader projection. | ||
| return PROJECTION_MODE.IDENTITY; |
There was a problem hiding this comment.
CRS viewports produce NaN shader origins
Medium Severity
A base Viewport with a crs is geospatial but now reports IDENTITY projection. Uniform setup still treats that combination as a lng/lat camera and reads longitude/latitude, which the base class no longer has, so geospatialOrigin and the shader origin become NaN. GPU rendering of this documented CRS camera is therefore invalid, even though CPU projectPosition still works.
Reviewed by Cursor Bugbot for commit fd28038. Configure here.


For #10739
TL;DR
Change List
@math.gl/projection alpha.17crs: CRSDescriptorproperty, dropslongitudelatitude, no longer contains web-mercator projection as geospatial fallbackOSMTile512describes MVT coordinate space.proj=geocentand are aligned to deck.gl common space with viewMatrix. Winding direction is not affected. AddearthModeloption to switch between WGS84 ellipsoid and v9.4/maplibre sphere.projection,toBoundsandgetDistanceScaleoptions. Use math.gl-resolved CRS descriptor to handle coordinate conversion, normalization, bounds, and distance scales.fromCrsin preparation for layer-owned source CRSprojectPosition(position, {sourceCrs})for explicit input CRS conversionNote
High Risk
Breaking changes to base Viewport and experimental CustomProjectionView APIs, plus refactors of all built-in geospatial viewports and coordinate/distance-scale paths that affect rendering and picking across the stack.
Overview
This PR routes deck.gl viewports through
@math.gl/projectionCRS descriptors instead of ad hoc converters and implicit Web Mercator fromlongitude/latitude.Custom projections are the largest API shift:
_CustomProjectionViewnow takes acrsstring (asyncinitialize()), WGS84 layer/camera/bounds semantics, and dropsprojection,fromCrs/toCrs,fromBounds/toBounds, andgetDistanceScale._CustomProjectionViewportuses descriptor converters,renderingBounds, andgetRenderingScalefor meter sizing and invalidation signatures.The base
Viewportgains optionalcrs,targetToCommonMatrix, and callabledistanceScales; geospatial mode follows the descriptor, not lng/lat alone.WebMercatorViewport,FirstPersonViewport, andGlobeViewportattach built-in descriptors (OSMTile512, geocentricGLOBE_CRS) while keeping Mercator/globe shader behavior;resolveCRScaches WGS84/globe/built-ins and asyncprojectionEngine.getCRS.projectPosition(..., { sourceCrs })allows explicit input CRS. Aggregation uses a linearAggregationViewportinstead of identity custom projection hacks.Docs, v10 upgrade notes, the custom-projection demo, and tests move to the new model;
ProjectionConverteris removed from public types.Reviewed by Cursor Bugbot for commit fd28038. Bugbot is set up for automated code reviews on this repo. Configure here.