This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
[core] #7319: Add support for filters in map.queryRenderedFeatures #8178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implemented support for filters in map.queryRenderedFeatures. This change allows providing layerIDs and/or Filters to the query method for filtering features. It supports the same basic Filter predicates as Layer filters.
This breaks a core API and needs additional work on the mobile SDK bindings
Usage:
Development Notes:
An existing QueryParameters struct was used internally in the SDK to pass the query related parameters down from the API. This change required adding parameters to the existing API method, and I chose to refactor the existing implementation to
The net result is that the API has a clean signature with a first class options struct, and the internal plumbing continues to use this directly. Additional context needed for performing queries is maintained as separate method arguments since those are likely to change less than the query options.
Testing & Verification:
This PR has been verified with unit tests. I've also updated the node bindings to be able to call new integration tests added to mapbox-gl-js in this PR
As part of the verification I've also updated the macosapp bindings. iOS and Android bindings need to be updated.
The performance of the filtering has not yet been benchmarked, and needs more work.