-
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
querySourceFeatures not working as expected #2481
Comments
This is the expected behaviour. We will update our docs to clarify this behaviour. |
OK, then does it make sense to combine the 2 methods? There is really little difference expect that
I still believe it would be useful to add another method which queried across all tiles (even non-visible). Although the client can still do this by filtering on |
This feature is not possible. |
I have an instance where I need to query features that are within the maps current bounding box, but are on layer which is currently not visible. Is this possible with either? Or is there another workaround that you suggest? |
@facultymatt |
Thanks @lucaswoj, Maybe you can help with the outcome I need:
Any suggestions? I know that I could always Thanks for helping with this! Obviously |
It sounds to me like you should use |
This is needed to enable searching, because querySourceFeatures only searches features within the viewport. See mapbox/mapbox-gl-js#2481
The docs still misleads people into thinking this filters against all features.
No mention of the fact that it seems to be filtering against the visible map area and the visible state of the features themselves. Why have a method named in this way when you have Further down in the docs it says:
|
It seems that
querySourceFeatures
only considers features within the current map bounds.Is this the expected behavior? The documentation suggests it considers all the source data, regardless of bounds. I believe it would be more useful to query all source data, since
queryRenderedFeatures
exists for querying within bounds.The text was updated successfully, but these errors were encountered: