This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
[core] Synchronize state of CollisionIndex and FeatureIndexes. - #10950
Merged
Merged
Conversation
Fixes issue #10778, in which mismatch between FeatureIndex and CollisionIndex could lead to inconsistent results or even invalid array access.
ansis
approved these changes
Jan 18, 2018
ansis
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me.
I don't have any good ideas about testing this
I still think the long term ideal solution is to make symbol querying not rely on CollisionIndex but thats a significant task.
Contributor
Author
|
There's another subtle change here, which is that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes issue #10778, in which mismatch between FeatureIndex and CollisionIndex could lead to inconsistent results or even invalid array access.
The expected behavior after this change is that the FeatureIndexes used by
queryRenderedFeatureswill only update at the same time placement finishes and the CollisionIndex is updated. This means the results will always be valid, and there shouldn't be any "flickering" in which a symbol disappears from query results in between the time a tile updates and the time the next placement happens. For non-symbol features, this change opens a gap between when they start being rendered (as soon as the tile loads) and when they show up in query results (when placement happens).This approach relies on placement happening all at once, so we can't port it directly to GL JS (and if we implement partial placement on gl-native we'll have to adjust this). I think a fuller solution would have the CollisionIndex either outright own the data it needs to return (too bulky?) or maybe have some form of shared ownership.
I don't have a good strategy for measuring the performance impact, but I think it should be pretty minimal -- it's basically just a delete gets deferred by up to 300ms when a tile updates.
I also don't know a great way to test this, since the flaw depends on precise timing and the logic isn't contained to a single unit. 😕
/cc @ansis