mapbox / mapbox/mapbox-gl-language

`findStreetsSource` causes `setLanguage` to fail

Open Beginner friendly
#62 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
204
Forks
51
PR merge metrics
No merged PRs in 30d

Description

findStreetsSource should check the actual version instead of the URL.

It fails with bright-v9 (https://api.mapbox.com/styles/v1/mapbox/bright-v9) and satellite-v9 (https://api.mapbox.com/styles/v1/mapbox/satellite-v9). Both styles are version: 8, but neither match the check (return url && url.indexOf('mapbox.mapbox-streets-v8') > -1 || /mapbox-streets-v[1-9][1-9]/.test(url);).

This check should probably be as follows:

return (style.version && style.version == 8) ||  (url && url.indexOf('mapbox.mapbox-streets-v8') > -1 || /mapbox-streets-v[1-9][1-9]/.test(url));

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 at the findStreetsSource check described in the issue and reproduce setLanguage with the bright-v9 and satellite-v9 style URLs. Done means both styles are recognized from their actual version and setLanguage no longer fails for them.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.