mapbox / mapbox/mapbox-gl-js

Layout and paint properties added after layer creation don't show up in queryRenderedFeatures results

Open
#11,584 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This was originally reported by @osvodef in https://github.com/mapbox/mapbox-gl-js/pull/10102

**mapbox-gl-js version**:
any

**browser**:
any

### Steps to Trigger Behavior

1. Create a map with a layer
2. Add a layout or paint property to the layer
3. Run `queryRenderedFeatures` and note that the dynamically added property is not in the results

### Link to Demonstration
https://jsfiddle.net/osvodef/f45dapvu/10/

### Expected Behavior
Dynamically added properties are shown in `queryRenderedFeatures` results.

### Actual Behavior
Dynamically added properties are not shown in `queryRenderedFeatures` results.

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 queryRenderedFeatures entry point and reproduce the behavior using the linked JSFiddle. Trace how dynamically added layout and paint properties are handled after layer creation, then add coverage showing that those properties appear in queryRenderedFeatures results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.