Add a `background-type` paint property
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
## Motivation
We've heard accounts of it being confusing that a checkered background was shown in Studio when choosing a projection other than `mercator`:

We create that checkered background in Studio **but more broadly**: It's slightly weird (exacerbated by `globe`) that a `background` layer wraps around a projection itself and isn't strictly the background styling of the canvas.
## Proposal
An enum that let's us change the behavior of background to render in governance to its projection or the viewport.
```json
"background-type": {
"type": "enum",
"default": "map",
"values": {
"map": {
"doc": "Renders the background layer to the projected map"
},
"viewport": {
"doc": "Renders the background layer to the canvas"
}
}
}
```
Doing something would also allow us to apply a `background-pattern` (i.e creating a starry space backdrop).
---
**Mapbox GL JS version:** `2.7.0-alpha.1`
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
The issue names Studio, the background layer, projections, and Mapbox GL JS 2.7.0-alpha.1, but no source files or tests. Start by locating the background paint-property definition and the rendering paths for projected maps and the canvas; done means supporting the map and viewport enum values while preserving the current default behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100