mapbox / mapbox/mapbox-gl-language
`findStreetsSource` causes `setLanguage` to fail
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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