visgl / visgl/deck.gl

[Doc] TileLayer example uses deprecated properties and does not work with typescript

Open
#8,467 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

doc
Dominant language
TypeScript
Stars
14.6k
Forks
2.3k
Avg merge
2d 9h
Merged PRs (30d)
42

Description

Link

https://deck.gl/docs/api-reference/geo-layers/tile-layer

Description

The section for renderSubLayers() does not work with typescript, also it uses the bbox property that is marked as @Deprecated.

renderSubLayers: props => {
                const {
                  bbox: {west, south, east, north}
                } = props.tile as any;

                return new BitmapLayer(props, {
                  data: null,
                  image: props.data,
                  bounds: [west, south, east, north]
                });
}

In typescript you have to specify props.tile as any. Also the BitMapLayer argument props throws an error.

Argument of type 'LayerProps & { _subLayerProps?: { [subLayerId: string]: { [propName: string]: any; type?: ConstructorOf<Layer<{}>>; }; }; } & _TileLayerProps<any> & { ...; }' is not assignable to parameter of type 'Partial<{ id: string; data: any; dataComparator: <LayerDataT = LayerData<unknown>>(newData: LayerDataT, oldData?: LayerDataT) => boolean; _dataDiff: <LayerDataT = LayerData<unknown>>(newData: LayerDataT, oldData?: LayerDataT) => { ...; }[]; ... 50 more ...; tile: Tile2DHeader<...>; } & Required<...> & Required<...>>'.
  Types of property 'data' are incompatible.
    Type 'any' is not assignable to type 'never'.ts(2345)

Contributor guide

Open the contributing guide

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.

Research direction

Start with the TileLayer API documentation page linked in the issue and inspect the renderSubLayers example alongside the current TileLayer and BitmapLayer TypeScript definitions. Update the example so it no longer relies on the deprecated bbox property and is accepted by TypeScript. Done means the documented example matches the current API and the reported type errors are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.