feat(mosaic)!: add explicit key?: string to mosaic sources#533
Merged
Conversation
Replaces the prior `x?` / `y?` / `z?` triplet on `MosaicSource` with a single optional `key: string` used as the tile-cache identifier in the inner Tileset2D. When `key` is omitted, the source's position in the `sources` array is used as the default, matching the previous behavior. Supplying an explicit `key` lets consumers keep a source's cache slot stable across reorderings or splices of `sources`. Closes #532 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
key?: string to mosaic sourceskey?: string to mosaic sources
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.
The typing here will be nicer after the upstream PR: visgl/deck.gl#10299
Summary
x?/y?/z?onMosaicSourcewith a single optionalkey: stringused as the tile-cache identifier in the inner Tileset2D.keyto the source's position insources(matching the prior behavior); supplying an explicitkeykeeps a source's cache slot stable across reorderings or splices.MosaicLayer'ssourcesdoc and the related tests; overridegetTileIdonMosaicTileset2Dto read from the resolved key.Closes #532
Test plan
pnpm vitest runinpackages/deck.gl-geotiff— 11/11 passingpnpm tsc --noEmitclean (pre-existingcog-layer.ts/cog-tile-matrix-set.tserrors unrelated)pnpm biome checkclean🤖 Generated with Claude Code