geoarrow / deck.gl-layers

deck.gl layers for rendering GeoArrow data
MIT License
73 stars 6 forks source link

wip: handle picking stroke of polygon layer #114

Open kylebarron opened 3 months ago

kylebarron commented 3 months ago

It would be nice to allow picking of both the underlying SolidPolygonLayer and the PathLayer.

In https://github.com/geoarrow/deck.gl-layers/pull/113 we enable the picked index from the SolidPolygonLayer to be proxied to the consumer of the PolygonLayer. This works because the data structure of the PolygonLayer is exactly the same as the data structure of the SolidPolygonLayer. And the SolidPolygonLayer handles the index conversions when rendering MultiPolygons to screen (in invertOffsets).

The thing is, with the PathLayer we need to apply invertOffsets twice. The PathLayer returns a single index into the expanded PathLayer table. But we need to map that back into the original polygon table passed in by the user.

kylebarron commented 3 months ago

I think something like the last commit will be useful. Where we take a sequence of offsets and invert all of them at once. Then we should be able to perform a lookup based on the global index of the path layer. But this doesn't quite work yet.