feature-state expression is incorrectly evaluated in queryRenderedFeatures
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
**mapbox-gl-js version**: 1.12.0
**browser**: Google Chrome v86
### Steps to Trigger Behavior
1. Use `feature-state` expression in a paint property for a symbol feature
2. Query this feature using `queryRenderedFeatures`
### Link to Demonstration
https://jsfiddle.net/osvodef/sdtr63jp/24/
### Expected Behavior
Feature state is taken into account, correct value of the property is returned.
### Actual Behavior
Default value of the property is returned.
The bug only affects symbol features. As far as I understood, this is because `lookupSymbolFeatures` doesn't pass `sourceFeatureState` arg to `loadMatchingFeatures` (in the file `feature_index.js`).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lookupSymbolFeatures and loadMatchingFeatures in feature_index.js, then reproduce the symbol-feature case from the linked JSFiddle. Verify that queryRenderedFeatures returns the property value produced by feature-state rather than the default value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100