deck.gl
deck.gl copied to clipboard
[Bug] CollisionFilterExtension over multiple TextLayers does not respect getCollisionPriority
Description
My ultimate goal is to have collision aware text labels with variable weight text. If there is a better way to achieve this I am certainly open to suggestions.
The natural approach seemed to be to create multiple text layers, each with a different fontWeight, all in the same (default) collisionGroup. From reading the documentation my understanding is that this should be equivalent to the collisions being computed over a single layer. However the results are quite different, with lower priority text showing behind higher priority text colliding with it, and occasionally lower priority text showing instead of higher priority text it collides with.
I created a codepen example here: https://codepen.io/lmcinnes/pen/KwKNLYY?editors=0010 In contrast the expected behaviour, with a single layer that has a single fontWeight has collisions working as I would expect, is in this codepen: https://codepen.io/lmcinnes/pen/ZYEBgYy?editors=0010
It is entirely possible that I am not understanding how to properly use the CollisionFilterExtension over multiple layers, and I would welcome clarification on that if that is the case.
Flavors
- [x] Script tag
- [ ] React
- [ ] Python/Jupyter notebook
- [ ] MapboxOverlay
- [ ] GoogleMapsOverlay
- [ ] CARTO
- [ ] ArcGIS
Expected Behavior
Expected behaviour should be similar to: https://codepen.io/lmcinnes/pen/ZYEBgYy?editors=1000
Steps to Reproduce
Current behaviour with strange collision results: https://codepen.io/lmcinnes/pen/KwKNLYY?editors=0010
Environment
- Framework version: deckgl@latest
- Browser: Chrome 133.0.6943.142
- OS: Windows
Logs
No response