Skip to content

fix(geo-layers): normalize legacy numeric coordinateSystem in Tile3DLayer - #10538

Open
mhayk wants to merge 1 commit into
visgl:masterfrom
mhayk:fix/tile-3d-layer-legacy-coordinate-system-10368
Open

fix(geo-layers): normalize legacy numeric coordinateSystem in Tile3DLayer#10538
mhayk wants to merge 1 commit into
visgl:masterfrom
mhayk:fix/tile-3d-layer-legacy-coordinate-system-10368

Conversation

@mhayk

@mhayk mhayk commented Aug 7, 2026

Copy link
Copy Markdown

Goal

Fixes #10368Tile3DLayer throws Invalid coordinateSystem: 2 when rendering i3s tiles.

deck.gl v9.3 migrated coordinateSystem from numeric enums to string constants (#10140). Released tile loaders still emit the old numeric value on parsed tile content — @loaders.gl/i3s sets METER_OFFSETS = 2. Tile3DLayer._makeSimpleMeshLayer() reads coordinateSystem straight off tileHeader.content and forwards it to the sublayer, so the numeric 2 reaches getShaderCoordinateSystem(), which rejects it:

deck: drawing MeshLayer({id: 'tile-3d-layer-mesh-49639-default-view'}) to screen: Invalid coordinateSystem: 2
    at getShaderCoordinateSystem (viewport-uniforms.ts:39:11)

Upstream fixed this in loaders.gl master (visgl/loaders.gl#3449), but the numeric values are still present in released 4.4.x builds, and Tile3DLayer accepts 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.ts

  • Add LEGACY_COORDINATE_SYSTEMS, mapping the pre-9.3 numeric values (-1, 0, 1, 2, 3) to their string constants.
  • Add normalizeCoordinateSystem() and apply it to the coordinateSystem read from tile content in _makeSimpleMeshLayer().
  • Unrecognized numeric values are passed through unchanged, so the core Invalid coordinateSystem validation 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 coordinateSystem props remain unsupported as documented in the v9.3 upgrade guide. normalizeCoordinateSystem is exported for the test only and is not re-exported from modules/geo-layers/src/index.ts.

Validation

  • test/modules/geo-layers/tile-3d-layer/tile-3d-layer.spec.ts — new Tile3DLayer#normalizeCoordinateSystem case covering each legacy numeric value, string pass-through, and unknown-value pass-through.
  • geo-layers headless suite: 20 files, 98 passed / 1 skipped.
  • node smoke tests: 15 passed.
  • biome check on both changed files reports no new findings (4 pre-existing noUnusedVariables warnings in the untouched defaultProps block are left alone to keep the diff focused).

Not run locally: yarn test-render (golden images) and the full yarn build.

…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
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.

bug(core): Tile3DLayer throws “Invalid coordinateSystem: 2” with @loaders.gl/i3s

1 participant