mapbox / mapbox/mapbox-gl-js

Heatmap layer doesn't respect slot property

Open
#13,115 2 comments 1 reaction 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**: 3.2.0

**browser**: Chrome 122

### Steps to Trigger Behavior

1. Add terrain source and layer to map
2. Add a line source and layer with `slot: "top"`
3. Add a heatmap source and layer `slot: "bottom"`
4. Lines cannot be seen above heatmaps

### Link to Demonstration

https://codepen.io/Jobbb/pen/MWRezXG

### Expected Behavior

Lines can be seen above heatmaps, as they were added after the heatmap layer and have `top` slot

Example from V2, terrain on, and `optimizeForTerrain` set to `false`, lines can be shown above heatmaps
Screenshot 2024-03-13 at 12 24 47

### Actual Behavior

Same example from V3, but lines are now batched with terrain and heatmap doesn't respect layer order or slot
Screenshot 2024-03-13 at 12 20 53

I understand that the line layers are effectively being baked into the terrain now in mapbox V3. If my example is actually misusing slots, would it be possible to exclude certain layers from the terrain batching process?

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 linked CodePen reproduction and compare the terrain, line, and heatmap layers using their `slot` values. Trace the terrain batching behavior described in the issue; done means lines in the `top` slot render above the heatmap in the terrain-enabled example.

Written by the indexing model from the issue text.

Assessment

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