mapbox / mapbox/mapbox-gl-js

How to change layer opacity when use 'mapbox://styles/mapbox/standard'

Open
#13,635 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged docs :scroll:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

I use the standard style: 'mapbox://styles/mapbox/standard', and this is my config:
```
const map = new mapboxgl.Map({
container: 'map',
// Choose from Mapbox's core styles, or make your own style with Mapbox Studio
style: 'mapbox://styles/mapbox/standard',
center: this.center,
zoom: this.zoom,
config: {
basemap: {
lightPreset: 'night'
}
},
antialias: true // create the gl context with MSAA antialiasing, so custom layers are antialiased
});
```

I wang to show pipeline under the background, how can I change the opacity of the background, roads, buildings?

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 with the Map constructor configuration shown in the issue and investigate how the standard style exposes background, road, and building layers. Verify whether opacity can be changed for those layers while keeping the pipeline visible, and document the supported approach or limitation. No specific repository files or tests are named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 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.