Evaluate query results on queryRenderedFeatures #5677 #5692
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.
Preface: the code in this PR likely needs to change, but I wanted to show a 'working' example and mention a possible fix if i'm on the right track.
If I understand the issue correctly, this PR will 'fix' #5677, and properly evaluate the current values before showing them.
The solution I wrote however is a bit hacky, as I realized a couple of things:
zoom
, which is not available during theserialize
method.serialize
to use the global property zoom and pass it along during the mapping of layout and paint would solve one problem and create another, as serialize is also used to grab non-evaluated results.I think
filterMatching
needs to separate some logic out forqueryRenderedFeatures
somehow, such that you don't need to check when the global context is valid to pass or not.My first impression is to maybe create a flag within
filterMatching
which defines whether to serialize and evaluate, or just serialize. That way it won't have to rely on checking whetherthis.coord.z
is defined or not to determine if the serialization should also perform evaluation.Something along the lines of:
Thoughts?
P.S. I used this example from the ticket to test this.