mapbox / mapbox/mapbox-gl-js

show3dObjects: false is ignored when terrain is enabled

Open
#13,622 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :lady_beetle:
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().

Image

### 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.