Skip to content

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

Merged
chrisgervang merged 4 commits into
visgl:masterfrom
mhayk:fix/tile-3d-layer-legacy-coordinate-system-10368
Oct 11, 2026
Merged

chrisgervang merged 4 commits into
visgl:masterfrom
mhayk:fix/tile-3d-layer-legacy-coordinate-system-10368

Conversation

@mhayk

@mhayk mhayk commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Goal

Fixes #10368 — Tile3DLayer 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.


Note

Low Risk
Localized compatibility shim at the tile-content → sublayer boundary; does not change public layer props or other coordinate paths in the file.

Overview
Fixes Invalid coordinateSystem: 2 when Tile3DLayer renders mesh tiles from loaders (e.g. @loaders.gl/i3s) that still attach pre–v9.3 numeric coordinateSystem values on tile content after deck.gl moved to string constants.

Adds normalizeCoordinateSystem(), mapping legacy numbers (-1–3) to the matching COORDINATE_SYSTEM.* strings and leaving string values and unknown numbers unchanged so core validation still catches bad input. _makeSimpleMeshLayer() now normalizes coordinateSystem from tileHeader.content before passing it to the mesh sublayer.

Tests cover the mapper (each legacy value, pass-through, unknown numeric) and that a mesh sublayer gets METER_OFFSETS when content reports 2.

Reviewed by Cursor Bugbot for commit 6cb3beb. Bugbot is set up for automated code reviews on this repo. Configure here.

@coveralls

coveralls commented Aug 12, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 83.602% (+0.06%) from 83.541% — mhayk:fix/tile-3d-layer-legacy-coordinate-system-10368 into visgl:master

…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
@mhayk
mhayk force-pushed the fix/tile-3d-layer-legacy-coordinate-system-10368 branch from 2c14c8b to b264808 Compare August 14, 2026 20:32
@mhayk

mhayk commented Aug 14, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto the latest master (fc1f5de) to bring this up to date — no conflicts, and the diff is unchanged from the approved version (only the base commit moved).

The test workflow is currently sitting at action_required on the new head (b264808), so it needs a maintainer to approve the run. It was green on the previous head. Could someone kick off the CI so this can land? Thanks!

@chrisgervang chrisgervang mentioned this pull request Oct 7, 2026
53 of 66 tasks
@chrisgervang chrisgervang added this to the v9.4 patch releases milestone Oct 11, 2026
…-10368

Resolve the spec import conflict: keep master's Deck/ScenegraphLayer/WebGPU
imports alongside the normalizeCoordinateSystem test.
@greptile-apps

greptile-apps Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous missing-test concern addressed.

Summary

Tile3DLayer translates legacy numeric coordinate systems from mesh tile content into current string constants.

  • Mesh tiles accept older numeric coordinate systems.

Reviews (3) · Last reviewed commit: "test(geo-layers): cover mesh sub layer l..." · Reviewed by Greptile

@chrisgervang
chrisgervang merged commit 675b626 into visgl:master Oct 11, 2026
8 checks passed
chrisgervang added a commit that referenced this pull request Oct 22, 2026
…ayer (#10538)

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

deck.gl v9.3 migrated `coordinateSystem` from numeric enums to string
constants (#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 #10368

* test(geo-layers): cover mesh sub layer legacy coordinateSystem path

---------

Co-authored-by: Chris Gervang <[email protected]>
Co-authored-by: Chris Gervang <[email protected]>
(cherry picked from commit 675b626)
@chrisgervang

Copy link
Copy Markdown
Collaborator

Released in deck.gl 9.4.1. Thanks @mhayk!

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

4 participants