DefinitelyTyped / DefinitelyTyped/DefinitelyTyped
'@types/mapbox-gl': Property 'setData' does not exist on type 'Source'
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 51.4k
- Forks
- 30.4k
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 108
Description
I tried using the @types/mapbox-gl package v.0.29.1 and had problems.
Since last Aug, we are to use map.getSource(...).setData(...) to update GeoJSON sources.
(https://github.com/mapbox/mapbox-gl-js/blob/master/CHANGELOG.md#0220-august-11-2016)
Also documented in the API docs:
https://www.mapbox.com/mapbox-gl-js/api/#GeoJSONSource
However, I'm getting the following Typescript error when trying to implement:
TS2339:Property 'setData' does not exist on type 'Source'
I'm not sure how to update or fix this...
- Authors: @dobrud, @alex3165, @andy-ms
Contributor guide
No contributing guide indexed for this repository
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 by comparing the @types/mapbox-gl v0.29.1 Source definition with the mapbox-gl GeoJSONSource API documentation linked in the issue. The work is done when TypeScript accepts getSource(...).setData(...) for GeoJSON sources without TS2339.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100