show3dObjects: false is ignored when terrain is enabled
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
### mapbox-gl-js version
v3.17.0
### Browser and version
Chrome, Mozilla
### Expected behavior
When show3dObjects is set to false in the style configuration (either directly in Mapbox Studio or via setConfigProperty('basemap', 'show3dObjects', false) at runtime), all 3D objects — including 3D buildings — should remain hidden regardless of whether terrain is enabled with setTerrain().
### Actual behavior
3D buildings reappear when terrain is enabled via setTerrain(), even though show3dObjects is set to false. Landmarks and trees are correctly hidden — only 3D buildings are affected.
### Link to the demonstration
https://jsbin.com/bulicibipi/edit?html,output
### Steps to trigger the unexpected behavior
1. Replace YOUR_ACCESS_TOKEN with a valid Mapbox access token
2. Set ENABLE_TERRAIN = false — 3D buildings are correctly hidden
3. Set ENABLE_TERRAIN = true — 3D buildings reappear despite show3dObjects: false
### Relevant log output
```shell
```
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 by reproducing the issue using the linked JS Bin, then trace how setTerrain() interacts with the show3dObjects style configuration and setConfigProperty('basemap', 'show3dObjects', false). Done means 3D buildings stay hidden when terrain is enabled, while landmarks and trees remain correctly hidden.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- computer-graphics, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100