[Feat] New `TileLayer` prop for fetching *multiple tiles* at once
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 14.6k
- Forks
- 2.3k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 42
Description
Target Use Case
Right now the TileLayer only has a single method for getting per-tile data: the getTileData callback.
This is fine, or at least, the best we can do for most tiled data sources, such as MVT from an API, since there's a separate URL per tile.
But for some data sources, such as PMTiles (which stores a pyramid of MVTs in a single range-request addressable resource) and Cloud-Optimized GeoTIFF (which contain a similar pyramid of raster image data), all tile requests are ranges within one specific URL.
As noted by TileLayer.maxRequests, Chrome only allows 6 concurrent requests per domain on HTTP 1.
But, since:
- these data sources are all contained in a single file/URL
- internal tiles are laid out in a predictable layout, such as horizontal rows or a hilbert curve
If we know we're fetching many tiles at once, we can coalesce adjacent HTTP Ranges and reduce the number of requests we're making.
Right now, since getTileData is called independently for every tile, it's very difficult to know from inside getTileData the set of tiles being fetched at a time, and so it's impossible to do this range coalescing.
Proposal
- Update
TileLayerwith a new user-facing propgetTileDataBatched(open to naming suggestions) that takes in an array of tiles and fetches all of them. This prop should be optional, falling back to callinggetTileDataifgetTileDataBatcheddoesn't exist - Update
Tileset2Dclass to callgetTileDataBatched. Ref https://github.com/visgl/deck.gl/blob/32c5d8d91dea69bc14839283c5bbc2600603725b/modules/geo-layers/src/tileset-2d/tileset-2d.ts#L264
ref https://github.com/developmentseed/deck.gl-raster/issues/273
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in modules/geo-layers/src/tileset-2d/tileset-2d.ts at the referenced Tileset2D call site, then trace TileLayer's existing getTileData prop. Define the optional batched callback's tile-array behavior and fallback to getTileData, ensuring Tileset2D can request multiple tiles together for range coalescing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100