deck.gl
deck.gl copied to clipboard
[Feat]getPickingInfo don't support async call
Target Use Case
When click a Tile3D layer, i want how the building info in a popup ui component by calling loadFeatureAttributes(info.object, info.index) which is a async function , but getPickingInfo of layer don't suppport async call
Proposal
Layer's getPickingInfo support async call.
getPickingInfo needs to be synchronous so that onHover/onClick etc are called promptly. If you need to perform some async action you can do so in your own app, something like
getPickingInfo({info}) {
info.getFeatureAttributes = async () => {
// wrap the async operation with internal information
};
}
And in your application
onClick: async (info) => {
const attributes = await info.getFeatureAttributes();
...
}
@Pessimistress thank you