tile spec v2 support: prepareLayer defaults to version 1 which throws warning in mapbox-gl-js
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 206
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
Right now `prepareLayer` [defaults to version 1](https://github.com/mapbox/vt-pbf/blob/master/index.js#L49) if no version is provided. This causes mapbox-gl-js to [throw a warning](https://github.com/mapbox/mapbox-gl-js/blob/355acfb8005ca985929ad9f24209beb099f92bc1/js/source/worker_tile.js#L84-L90) that the tile source does not use vector tile spec v2.
There doesn't seem to be a way to provide `version` in `fromGeojsonVt` that can override this default, but it would be awesome to have tile spec v2 support when converting from GeoJSON.
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 index.js at prepareLayer and trace the fromGeojsonVt conversion path to see how options reach the default version. Add a way for GeoJSON conversion to produce vector tile spec v2 output, then verify that the generated tile no longer triggers the mapbox-gl-js warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100