Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip: handle picking stroke of polygon layer #114

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kylebarron
Copy link
Member

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

In #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
Copy link
Member Author

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.

Base automatically changed from kyle/polygon-layer-picking to main March 22, 2024 21:43
kylebarron added a commit to developmentseed/lonboard that referenced this pull request Mar 28, 2024
It looks like this is now working! 

<img width="686" alt="image"
src="https://github.com/developmentseed/lonboard/assets/15164633/91edc23d-0ecd-49c0-bf1e-0068a617a8fb">

This does have the caveat that picking currently only works for
_polygons_ and not their associated exteriors. See
geoarrow/deck.gl-layers#114


Todo:

- [x] Use PolygonLayer as the default polygon rendering in `viz`
- [x] Render stroke by default in `viz`.
- [ ] Get input from designers on good default colors for the Polygon
exterior
- [x] Document difference between the two polygon layers
- [x] Use published @geoarrow/deck.gl-layers beta, instead of local
install.

Closes #197

-----


Old:

It turns out that there are still some issues on the JS side of the
PolygonLayer. I think I had only tested it with Polygon, not
MultiPolygon, input, which is why I didn't catch these two.

More info in geoarrow/deck.gl-layers#102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant