Repository navigation
Pickable not working when supplying attributes directly #7503
|
I made a plain javascript PoC for tracking a set of vehicles on a map using the ScatterPlotLayer. Server polling is made in a worker thread that uses postMessage to send the indices array (plain js array of integers) and the positions array (typed float32) to the map. In order to update the positions I am following the https://deck.gl/docs/developer-guide/performance#supply-attributes-directly and everything works as expected except when I enable pickable that makes the points disappear. The main code is: If I add an additional ScatterPlotLayer using JSON data and accessors it works so it seems a problem when supplying attrs directly. Could you give me some advice on how to solve it?. BTW, what's the role of the indices array? Now I am always updating the full positions array and setting indices array from 0 to array len -1. Could it be possible to send only the positions that have changed from one server request to next and use the indices array to let deck.gl know which entries in the complete buffer are being passed. Thank you. |
Replies: 2 comments
ScatterplotLayer does not use any attribute called indices. You can remove it. A layer's data prop is only processed when its value shallow changes. You should not mutate the same data object on updates. |
ScatterplotLayer does not use any attribute called indices. You can remove it.
A layer's data prop is only processed when its value shallow changes. You should not mutate the same data object on updates.