mapbox / mapbox/mapbox-gl-js

Sort key not working across different layer types

Open
#13,013 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

If you have 2 layers of different types, the sort keys won't be taken into consideration, meaning that fill layers could be rendered on top of a symbol even though they have sort keys that suggest that the symbol should be on top.

Steps to Trigger Behavior
  1. Create a symbol layer with a single item, have a sort key of 100
  2. Create a fill layer of a single polygon that contains the symbol location, make it have a sort key of 90
  3. The fill layer will be above the symbol
Expected Behavior

Sort key will be calculated among all layer types and be global

Actual Behavior

Sort keys only work on same layer types

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 with the two layer types and sort keys described in the steps. Trace the layer-ordering path that handles symbol and fill layers, then verify that a symbol with key 100 renders above a fill with key 90 and that same-type ordering remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.