IconLayer's PickInfo does not include object when data iterable is a Map
Description
When using IconLayer's onClick or onHover properties, the PickInfo argument of the callback should include the object from the data. When the data property is an array this works fine, but when the data property is a Map the object is missing.
Flavors
- [X] React
- [ ] Python/Jupyter notebook
- [ ] MapboxLayer
- [ ] GoogleMapsOverlay
- [ ] CartoLayer
- [ ] DeckLayer/DeckRenderer for ArcGIS
Expected Behavior
The PickInfo argument should include the data object when using any Iterable for the data property, not just when it is an array.
Steps to Reproduce
Reproduced in the following code sandbox: https://codesandbox.io/s/competent-smoke-enxlcx?file=/src/App.tsx
Hover over the two different icons to see the PickInfo logged to the console for both scenarios.
Environment
- Framework version: 8.3.10
Logs
No response
This is expected. The picked index is used to retrieve object as data[index]. If your data is not an array then it's not going to be populated. You can still get the object yourself with something like Array.from(data)[info.index]. Indexing into arbitrary iterables is unlikely to be supported out of the box because it will have a significant impact on the picking performance.
Ok thanks for the explanation.