-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 and icon-allow-overlap #5172
Comments
I'm also encountering this EXACT same issue. Is there any headway on looking into this? |
We should investigate this bug after #5150 lands in master |
@ttsirkia or @Erutan409 can you test this with the latest version of |
@ChrisLoer I'll try to reproduce the issue soon and report my findings. |
I can still replicate the bug but the behavior is a bit different. Now the rendered icon is sometimes returned and sometimes not depending on the map position. If I drag the map, I get different results although the icon is always visible. I have to see if I can create a minimal JSFiddle. |
@ttsirkia Thanks! I can take a look once you've got the fiddle. |
@ChrisLoer I think I "solved" my issue by dynamically adding the icons after loading the style. So, I'm not experiencing it anymore. But, that's not to say the root cause is fixed. And I unfortunately can't create a test case with the data/style I'm using. I'm not at liberty to make public until it's actually approved to merge into production. Sorry :\ |
Here https://jsfiddle.net/0b9m5y2e/ is a simple example to reproduce the issue. Zoom in and see how the counter becomes zero. |
Thanks @ttsirkia, that's a really useful fiddle. There's definitely something wrong here -- I quickly put a breakpoint in the fiddle and saw that the text is getting returned from the underlying query but the icon is getting filtered out. I haven't figured out why yet, but I'll look into it and hopefully we can fix this quickly. |
I noticed that using the same data source for the both layers was crucial. If there were two separate data sources, this bug did not appear. |
It looks to me like the bug is in this code: There are two items in the collision index (one for the icon, one for the text), but since they're both based on the same feature from the same I think the right fix here is to include It looks like we've had this bug for a long time, and it managed to survive the refactoring of #5150. ;) |
Fixes issue #5172: items from multiple layers but sharing a common source feature would only show up in queryRenderedSymbols results for one of the layers.
Creates two layers that both include a feature from the same source. Filter query results to just one of the layers.
Fixes issue #5172: items from multiple layers but sharing a common source feature would only show up in queryRenderedSymbols results for one of the layers.
Creates two layers that both include a feature from the same source. Filter query results to just one of the layers.
mapbox-gl-js version: 0.39.1
Steps to Trigger Behavior
icon-allow-overlap
istrue
queryRenderedFeatures
although still visible (symbol would be hidden in this case withouticon-allow-overlap
)Expected Behavior
queryRenderedFeatures
returns always the visible elementsActual Behavior
queryRenderedFeatures
acts asicon-allow-overlap
isfalse
and ignores some visible elementsThe text was updated successfully, but these errors were encountered: