Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QueryRenderedFeatures returning duplicated features #12346

Open
sienki-jenki opened this issue Oct 28, 2022 · 0 comments
Open

QueryRenderedFeatures returning duplicated features #12346

sienki-jenki opened this issue Oct 28, 2022 · 0 comments
Labels

Comments

@sienki-jenki
Copy link

mapbox-gl-js version: 2.10.0

browser: Google Chrome Version 107.0.5304.62 (Official Build) (x86_64)

Steps to Trigger Behavior

  1. Create geojson source
  2. Attach 2 separate layers that are using single source
  3. Use queryRenderedFeatures

Link to Demonstration

https://codepen.io/sienki-jenki/pen/rNvOqGy

I have 1 source that is used by 2 layers, when I use map.queryRenderedFeatures(event.point,{layers:["circle-layer"]}) it should return 1 feature since only one feature is rendered on circle-layer. But it actually duplicates feature because(?) circle-label layer is also using same source.

Expected Behavior

Only 1 feature is returned from queryRenderedFeatures

Actual Behavior

2 duplicated features are returned from queryRenderedFeatures

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants