mapbox / mapbox/mapbox-gl-js

Style spec validator allows `projection.name = 'globe'` for GL JS `2.6.0`

Open
#12,028 0 comments 2 reactions 0 assignees View on GitHub
api :memo: bug :lady_beetle:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

The styles-spec's `sdk-support` field only specifies versions for fields, not for values: https://github.com/mapbox/mapbox-gl-js/blob/b13b0aed81d9d552da9cec0f570bdb52b8750137/src/style-spec/reference/v8.json#L4112

This can lead to users unintentionally marking their styles as supported by GL JS `2.6.0`, even though `globe` projection (which is now the default) was not yet supported at that time.

studio-globe-supported-260

**mapbox-gl-js version**: 2.9.1

**browser**: Firefox 101.0.1

### Steps to Trigger Behavior

1. Login to [Studio](https://studio.mapbox.com)
1. Create a new style (with `globe` projection by default)
1. (optional) Disable atmosphere to prevent warnings about it
1. Switch `Settings -> Supported Mapbox SDK versions -> Mapbox GL JS` to `2.6.0`
1. Notice that there are no warnings about `projection` (or anything at all, if you removed atmosphere) from GL JS

### Expected Behavior

A warning about `globe` projection is displayed

### Actual Behavior

No warning is displayed

Contributor guide

Open the contributing guide

Research direction

Start with the sdk-support definition in src/style-spec/reference/v8.json at the linked location, then trace how the style-spec validator evaluates supported values. Reproduce the Studio steps with globe and GL JS 2.6.0; done means the validator reports a warning for the unsupported projection.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, tooling
Issue type
Bug
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.