RFC(geo-layers) SharedTileLayer#10367
Draft
ibgreen-openai wants to merge 3 commits into
Draft
Conversation
This was referenced Jun 11, 2026
55 tasks
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 deck.gl-community SharedTileLayer allows multiple layers x multiple views to load from the same tile source and reuse common tiles across views.
The community demo is here: https://visgl.github.io/deck.gl-community/docs/modules/geo-layers/api-reference/shared-tile-2d-layer
It would likely be a great basis for TerrainLayer, sharing terrain tiles between layers.
One tricky question is whether to try to make this layer replace TileLayer, that layer is heavily customizable and changing the implementation may be risky, and will likely break some applications.
Make Shared Tile Layer the TileLayer Replacement
Summary
_SharedTile2DLayerpath with a shared-backedTileLayerimplementation.TileLayeras the canonical public class and preserve strict drop-in compatibility for current props, subclasses, exported helper classes, callbacks, tests, and in-repo consumers._SharedTile2DLayer,_SharedTileset2D, and_SharedTile2DHeaderas experimental alias exports around the same implementation, not a second behavior path.Key Changes
TileLayer/Tileset2Dstack soTileset2Downs shared tile content, loading, request scheduling, cache eviction, stats, TileSource metadata, and subscriptions._Tile2DHeadercompatibility by exposing stable view-scoped tile header facades with existing fields:isSelected,isVisible,state,layers,parent,children,content,data,isLoaded,isLoading,needsReload,abort, andsetNeedsReload.TilesetClass?: typeof Tileset2Dworking unchanged. Existing_Tileset2Dsubclasses such as H3, Quadbin, and custom app tilesets continue overridinggetTileIndices,getTileId,getTileZoom,getTileMetadata, andgetParentIndex.refinementStrategycallbacks. Run them per viewport against that viewport’s tile header facades so mutations do not leak between views.TileLayerinstance automatically share tile content across all rendered viewports. Separate layer instances share only when passed the same external_SharedTileset2D.TileLayer.dataadditively to accept URL templates, loaders.glTileSource, or an external_SharedTileset2D. URL-template behavior remains exact; explicit layer props override TileSource metadata; external tilesets are not finalized by layers.tile.layerscaching semantics per layer/view,renderSubLayers,filterSubLayer, picking info,onViewportLoad,onTileLoad,onTileUnload,onTileError, errored-tile loaded state, abort/reload behavior, repeat views, and current cache defaults.state.tilesetand public-ish tileset fields usable. For direct legacy access,tiles,selectedTiles,isLoaded,isTileVisible,_tiles,_cache, andoptsreflect the active/default view; directtileset.update(viewport)uses a default legacy view.Public API
TileLayerbecomes the shared-backed replacement._SharedTile2DLayerbecomes an alias ofTileLayer._SharedTileset2Dbecomes an alias or thin experimental wrapper over_Tileset2D._SharedTile2DHeaderbecomes an alias of_Tile2DHeader.SharedTile2DLayerPropsaliasesTileLayerProps.SharedTile2DLayerPickingInfoaliasesTileLayerPickingInfo.SharedTileset2DProps/ related shared tileset types map to the compatibleTileset2Dsurface.SharedRefinementStrategyaliasesRefinementStrategy, including custom callback functions.@deck.gl/geo-layersanddeck.gl; do not add a separate tileset subpath.Docs And Example
TileLayerdocs to describe shared cache behavior, multi-view sharing, TileSource input, and external_SharedTileset2D.docs/developer-guide/views.md,docs/whats-new.md, and affected WebGPU notes.TileLayeras the main layer API and_SharedTileset2Donly for explicit cross-layer sharing across main/minimap views.Test Plan
TileLayer,Tileset2D,Tile2DHeader,MVTLayer,TerrainLayer, CARTO, and custom tileset tests passing unchanged.yarn,yarn build,yarn lint,yarn test-headless,yarn test-browser, andyarn test-website.Assumptions
_Tileset2D/_Tile2DHeaderextension points and in-repo state usage.TileLayeris the final user-facing replacement;_Shared*names remain transitional experimental aliases.MVTLayer,TerrainLayer, CARTO layers, and customTilesetClassimplementations should not require source changes beyond incidental type fixes if the refactor exposes existing type gaps.