I have a project using a React, Mapbox, and Deck.gl stack. I'm trying to query the features on a styled map but am having trouble implementing Deck.gl's getRenderedFeatures
function, even after looking at the documentation.
My current React component:
<DeckGL
{...deckGLProps}
layers={layers}
onViewportChange={() => console.log(mapRef)}
ref={mapRef}
getRenderedFeatures={(e) => console.log(e)}
>
<StaticMap
ref={mapRef}
visible={!level}
{...staticMapProps}
{...viewport}
mapStyle={mapStyle[0]}
/>
</DeckGL>
I understand that querying getRenderedFeatures
on onViewportLoad
is recommended, but I can't find an implementation that works.
Does anyone have a working implementation of getRenderedFeatures
or a link to better documentation on the function?