mapbox / mapbox/mapbox-gl-traffic

Configurable source layer ID

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
108
Forks
36
PR merge metrics
No merged PRs in 30d

Description

The current implementation is hardcoded to inject itself when it finds a "source-layer" with ID "road". Probably works for most of Mapbox' styles but I've had style formats that didn't use that naming convention. I suggest exposing the source-layer ID (or maybe more than one?) as an option for better configurability.

(related, if it doesn't find a source-layer an empty array check could be done and maybe log for more graceful error exit)

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 by locating the implementation that searches for a source-layer with ID "road" and trace how its options are supplied. Define the desired configuration shape and verify behavior with a style using a different source-layer ID; also check the missing-layer path for a graceful result or log message.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.