mapbox / mapbox/vt-pbf

tile spec v2 support: prepareLayer defaults to version 1 which throws warning in mapbox-gl-js

Open
#12 2 comments 0 reactions 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.