-
-
Notifications
You must be signed in to change notification settings - Fork 777
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 within feature collection not working #3540
Comments
Yes, this looks like a bug. I also tried to add a test to the expressions test with this use case and it seems to fail, so it looks like an actual bug that should be easy to test, reproduce, and hopefully solve. Let me know if you would like to try and tackle this. |
Thanks so much for the prompt dive into this @HarelM ! Really appreciate that. I would like to help with a fix. I'm a bit low on cycles right now so I may have to use the Thanks again! |
Found the issue, it does only take the first one apparently. |
Thank you @HarelM, glad to hear you tracked the problem down 🤩 (And thank you @sbachinin for putting in a fix!) I'll keep an eye on maplibre/maplibre-style-spec#477 and start using that code once it's merged. |
maplibre-gl-js version: 3.6.2
browser: Brave 1.61.109 (Chromium 120.0.6099.144)
Steps to Trigger Behavior
queryRenderedFeatures
on the point layer, providing afilter
with awithin
expression and a GeoJSON feature collection of polygons that contain the pointsLink to Demonstration
I've created a minimal example of this which
within
a feature collection of polygonshttps://codepen.io/rbrtmrtn/pen/abMvYvK
Expected Behavior
Both points should turn red because both of the are
within
the feature collection.Actual Behavior
Only one is red. The issue seems to be that
queryRenderedFeatures
is only returning a single point — the one that falls within the first polygon encountered in the feature collection. Looking at the docs forwithin
expressions, however, it looks like a feature collection should be a valid argument.The text was updated successfully, but these errors were encountered: