Layer click event returns features in layers created from the same data source.
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**: 2.2.0
**browser**: Chrome, Firefox and Edge
### Steps to Trigger Behavior
1. Creates two layers from a single data source.
2. Add click event on one layer.
3. Click on one feature of the layer. It will return two features.
### Link to Demonstration
https://jsbin.com/foseqejoca/edit?html,output
1. Click on [Add layers from same data source] button, then layers are created from same data source and added to the map.
2. Click on circle feature and check console. Two features are returned, even though you clicked single feature.
3. Click on [Add layers from different data source] button, then layers are created from different data source and added to the map.
4. Click on circle feature and check console. One features are returned.
### Expected Behavior
Return only one feature from clicked layer.
### Actual Behavior
Return two features from all layers created from same data source.
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
Reproduce the behavior using the linked JSBin by adding layers from the same data source and clicking a feature, then compare it with layers using different sources. Trace the click event's returned features and consider the issue done when clicking one layer returns only that layer's feature.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100