fix(geo-layers): normalize legacy numeric coordinateSystem in Tile3DLayer - #10538
Open
mhayk wants to merge 1 commit into
Open
fix(geo-layers): normalize legacy numeric coordinateSystem in Tile3DLayer#10538mhayk wants to merge 1 commit into
mhayk wants to merge 1 commit into
Conversation
…ayer deck.gl v9.3 migrated `coordinateSystem` from numeric enums to string constants (visgl#10140). Released tile loaders such as `@loaders.gl/i3s` still set the old numeric value (`METER_OFFSETS = 2`) on parsed tile content, so `Tile3DLayer._makeSimpleMeshLayer()` forwarded `2` to the shader system and rendering failed with `Invalid coordinateSystem: 2`. Translate the numeric values reported by tile content back to the string constants before they reach the sublayer. Unrecognized values are passed through unchanged so the core validation still reports them. Fixes visgl#10368
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Fixes #10368 —
Tile3DLayerthrowsInvalid coordinateSystem: 2when rendering i3s tiles.deck.gl v9.3 migrated
coordinateSystemfrom numeric enums to string constants (#10140). Released tile loaders still emit the old numeric value on parsed tile content —@loaders.gl/i3ssetsMETER_OFFSETS = 2.Tile3DLayer._makeSimpleMeshLayer()readscoordinateSystemstraight offtileHeader.contentand forwards it to the sublayer, so the numeric2reachesgetShaderCoordinateSystem(), which rejects it:Upstream fixed this in loaders.gl master (visgl/loaders.gl#3449), but the numeric values are still present in released
4.4.xbuilds, andTile3DLayeraccepts tile content from any loader — including third-party ones. Normalizing at that boundary keeps deck.gl working regardless of which loader version is installed.Changes
modules/geo-layers/src/tile-3d-layer/tile-3d-layer.tsLEGACY_COORDINATE_SYSTEMS, mapping the pre-9.3 numeric values (-1,0,1,2,3) to their string constants.normalizeCoordinateSystem()and apply it to thecoordinateSystemread from tile content in_makeSimpleMeshLayer().Invalid coordinateSystemvalidation still reports genuinely bad input rather than this shim masking it.The public API is untouched: this only translates loader-provided values, so raw numeric
coordinateSystemprops remain unsupported as documented in the v9.3 upgrade guide.normalizeCoordinateSystemis exported for the test only and is not re-exported frommodules/geo-layers/src/index.ts.Validation
test/modules/geo-layers/tile-3d-layer/tile-3d-layer.spec.ts— newTile3DLayer#normalizeCoordinateSystemcase covering each legacy numeric value, string pass-through, and unknown-value pass-through.biome checkon both changed files reports no new findings (4 pre-existingnoUnusedVariableswarnings in the untoucheddefaultPropsblock are left alone to keep the diff focused).Not run locally:
yarn test-render(golden images) and the fullyarn build.