mapbox-gl-js
mapbox-gl-js copied to clipboard
feature-state events (hover) stop working when many 3D models are rendered in a `model` layer
Mapbox-GL-JS Version: 3.1.2
Browsers Tested:
- Chrome (Version 120.0.6099.234)
- Firefox (121.0)
Steps to Reproduce
- Clone the repository from https://github.com/Jaszkowic/feature-state-bug (public repo, minimal example)
- Create an
.envfile withREACT_APP_MAPBOX_ACCESS_TOKENset properly - Run
npm install - Run
npm start - Hover over a rendered tree circle; opacity should change, and the 3D model should scale bigger (works fine in the initial setup)
- Change the number of rendered trees (
numTreesvariable) in./src/Map.jsand reload - For small numbers (< 50, exact number unclear), everything works fine
- For larger numbers (e.g., > 100 - reproducible in my case), the hover effect still works on the 2D circles but stops working on most of the 3D models. Strangely, some randomly selected 3D models still work.
Demonstration Link
Public repo, minimal example: https://github.com/Jaszkowic/feature-state-bug
Expected Behavior
feature-state events like hover should work for a large number of rendered 3D features in a layer of type model, as documented here:
[...]
model-scaleSupports feature-state
I understand that the model layer is in an experimental state. Maybe there is still some limitation here? If yes, could you clarify what the exact limitations are?
Actual Behavior
feature-state events like hover cease to work for a large number of rendered 3D features in a layer of type model.
Thank you for your help!
Thanks for reporting. This is a bug that we will work on.
HI @astojilj, any updates on this? Is there a rough timeline when work on this could bug could start? Thanks again.
This is expected in mapbox-gl-js v3.5 (second half of June 2024). Sorry, for the long wait.
It is already available in v3.4 beta. Closing it - please reopen if not working: