mapbox / mapbox/vector-tile-js

need to handle multiple layers with the same name

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

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
405
Forks
90
PR merge metrics
No merged PRs in 30d

Description

If you composite two VTs with the same layer name, the resulting vector tile will have two layers with that name.

Background:
- https://gist.github.com/springmeyer/3522514c85443b57e338
- https://github.com/mapbox/mapnik-vector-tile/issues/20

Currently, vector-tile-js will [drop all but the last encountered layer](https://github.com/mapbox/vector-tile-js/blob/5b562b945aa552f48b3e0b6fb37c5de08a5219af/lib/vectortile.js#L14). Instead, it should either:
- merge features from all layers with the same name, or
- store layers in an array rather than a map

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 lib/vectortile.js at the linked layer-handling code and review the background references for how duplicate layer names should behave. Resolve whether same-named layers are merged or retained separately, then verify that compositing two such layers no longer silently drops all but the last one.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.