mapbox / mapbox/mapbox-gl-js

Unable to order circle layer underneath fill layer

Open
#13,320 0 comments 0 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**: 3.7.0

**browser**: Google Chrome 130.0.6723.117

### Steps to Trigger Behavior

Create a map instance with two layers, a 'fill' type and a 'circle' type.

I am unable to get the 'circle' layer to appear beneath the 'fill' layer.

### Link to Demonstration

https://codepen.io/farseekers/pen/XWvxMmd

### Expected Behavior

As seen in the demonstration, I've tried
- adding the circle layer before adding the fill layer
- adding the circle layer after adding the fill layer
- adding the circle layer with the 'beforeId' of the fill layer

I expect it to be possible to have a circle layer to sit underneath a fill layer, but so far, it does not seem to be the case.

### Actual Behavior

All circle layers sit above the fill layer

![Screenshot 2024-11-07 at 9 23 48 am](https://github.com/user-attachments/assets/903808f7-8ef3-4ddb-b023-2288cb592c73)

Thanks for any assistance.

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

Open the linked CodePen reproduction and inspect the map setup, focusing on the fill and circle layer definitions and their insertion order and beforeId usage. Confirm the expected stacking behavior against the reported result; done means reproducing the issue and narrowing whether the behavior is caused by layer ordering or the rendering subsystem.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend, web-dev
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.