[Feat] TileLayer adapter prop for Tileset2D adapters

Open
#11,340 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

  • #11341 by @athomct — closed without merging

Assessment

Difficulty
3/5
Estimated time
Half a day
Newbie friendliness
40/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript

Research direction

Start from how TileLayer creates its Tileset2D through the TilesetClass prop, and from the adapter option that Tileset2D already accepts. Add an adapter prop on TileLayer with a default of null, and pass it to the tileset, creating a new tileset when the adapter changes. Keep an adapter that a custom TilesetClass sets whenever the prop is null. Linked PR #11341 was closed without merging, so check why before starting. Done means the AdapterTileset2D subclass example is no longer needed.

Written by the indexing model from the issue text.

Description

Target Use case

Tileset2D takes an adapter option, but TileLayer has no prop for it. To use an adapter, for example the loaders.gl createTileMatrixTileset2DAdapter for a COG in its own CRS, an app must write a Tileset2D subclass only to pass the adapter:

class AdapterTileset2D extends Tileset2D {
  constructor(opts) {
    super({...opts, adapter});
  }
}
new TileLayer({TilesetClass: AdapterTileset2D, ...});
Proposal

An adapter prop on TileLayer, default null, passed to the tileset. A new adapter object creates a new tileset, because it can change tile ids and bounds. When the prop is null, an adapter that a custom TilesetClass sets stays, so existing subclasses do not change.

Dominant language
TypeScript
Stars
14.8k
Forks
2.3k
Avg merge
1d 9h
Merged PRs (30d)
230

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from visgl/deck.gl

All issues in visgl/deck.gl

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.