Detect and warn incorrect source-layer
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
[This question](https://stackoverflow.com/questions/56827408/tippecanoe-generated-pbf-stored-on-s3-visualised-on-mapbox-gl/56830320) on Stack Overflow reminded of this common pain point: when a layer definition includes `source-layer` that doesn't correspond to any actual source layer, Mapbox-GL simply fails to render anything, with no warning.
My understanding is that the library should have access to the list of actual source layers for any vector source loaded via TileJSON. So in theory it should be possible to check that the requested `source-layer` is in that list, and if not, output a warning, something like:
`Warning: source-layer "trees" does not exist in vector tile source "test". No features will be displayed.`.
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 by tracing how vector sources loaded via TileJSON expose their actual source layers and how style layers consume source-layer. Done means warning when a requested source-layer is absent, while valid source layers continue rendering normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100