mapbox / mapbox/mapbox-gl-js

symbol-sort-key doesnt influence feature order of queryRenderedFeatures

Open
#10,800 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug :lady_beetle: needs investigation :mag:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

If symbol-sort-key is used the markers are visuell sorted by a property. But by click on the higher marker the lower will be first in the list of queryRenderedFeatures.

**mapbox-gl-js version**: 2.3.1

**browser**: Chrome

### Steps to Trigger Behavior
1. open example
2. zoom out until markers overlaps each others
3. click on a marker

### Link to Demonstration
https://jsfiddle.net/7t02vbhc/63/

### Expected Behavior
console should output A

### Actual Behavior
console output B

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 JSFiddle and trace the queryRenderedFeatures result ordering for overlapping markers using symbol-sort-key in mapbox-gl-js 2.3.1. Reproduce the Chrome behavior by zooming out and clicking a marker; done means the console reports A, with the higher visually sorted marker first.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.