mapbox / mapbox/mapbox-gl-js

Query rendered features accuracy decreases when terrain is present

Open
#13,604 4 comments 2 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.17.0

Browser and version

Chrome 142.0.7444.176

Expected behavior

The queryRenderedFeatures function should return the features that the cursor is over.

Actual behavior

The queryRenderedFeatures function doesn't always return the features that the cursor is over.

Link to the demonstration

https://jsbin.com/cayofanaca/edit?html,output

Steps to trigger the unexpected behavior

I understand that this is not always the case and sometimes queryRenderedFeatures does work correctly when terrain is enabled. Quite possible it might be due to the camera angles and zoom level I am using, when there is no bearing it seems to work better.

There is a video below of the issue I am having in the example I linked above.

https://github.com/user-attachments/assets/433c9d1b-4a7b-4943-a0c6-ce0923a07bb1

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 running the JSBin demonstration with mapbox-gl-js 3.17.0 and compare queryRenderedFeatures results against the cursor position with terrain enabled. Exercise the camera angles, bearing, and zoom levels described in the issue; done means features under the cursor are returned consistently in the reproduced terrain cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
computer-graphics, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.