fix(layers): Fix MVTLayer + pickMultipleObjects #9246
Merged
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.
The
instancePickingColors
attribute has some hard-coded assumptions about size, such as...deck.gl/modules/core/src/lib/layer.ts
Lines 879 to 882 in 27d2010
... but MVTLayer currently initializes the buffer with 3, not 4, components. This leads to a bug in
pickMultipleObjects
wheredisablePickingIndex
fails to disable the previously selected object index (or goes out of bounds) and the operation just returnsdepth
duplicate references to the top hit.While we could try to handle multiple attribute sizes, I think it's probably preferable to just have one way to represent things. Here I've switched MVTLayer to 4-component picking colors, following WebGL's 4-byte alignment best practices.
Change List