mapbox / mapbox/mapbox-gl-js

Display the value of `layer.id` on validation

Open
#8,455 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api :memo: feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

Right now - If I write a bad value for a filter - the errors returned look like this:

Screen Shot 2019-07-10 at 4 35 27 PM

Displaying the array index layer[125] is less helpful if I'm writing a style in a text editor or my style is compiled from a bunch of layer scripts into one stylesheet.

It would be very helpful if the name of the layer (in this case a layer I've named transit-station-label was displayed. Then I would have string to search / I could quickly identify the mistake I've made in authoring.

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

Locate the validation path that currently reports a layer by its array index, then inspect how each layer's id is available during validation. Update the diagnostic so a named layer such as transit-station-label can be identified, and verify that invalid filters report the layer id instead of only layer[125].

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.