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

Map view state #57

Closed
bdbmax opened this issue Mar 14, 2022 · 5 comments
Closed

Map view state #57

bdbmax opened this issue Mar 14, 2022 · 5 comments

Comments

@bdbmax
Copy link

bdbmax commented Mar 14, 2022

Hello Anthony!

Maybe you've already implemented this: is there a way to retrieve the view states from the map in R, at the moment with rdeck? States such as zoom and central point. Mapdeck does this with input${map_id}_view_change, I guess using onViewStateChange function from deck.gl.

And thanks for your package!

@bdbmax
Copy link
Author

bdbmax commented Mar 14, 2022

My question maybe goes deeper, I'm wondering about retrieving any type of information from the deck to R, so that the zoom, bbox, a click event, etc. can be used as an input in other R calculations. There's the pickable argument to every layer, which I believe is used to inform a click event on an object in a pickable layer? Is this already fully implemented in rdeck, or it is only used in the hover event situation?

@anthonynorth
Copy link
Member

Currently, pickable is used only for tooltips via onHover. I'm currently implementing feature click for shiny, it'll be ready (probably) by tomorrow.

onViewStateChange is trivial, that'll be ready soon also.

@bdbmax
Copy link
Author

bdbmax commented Mar 15, 2022

Great work! Thanks!

@bdbmax bdbmax closed this as completed Mar 15, 2022
@anthonynorth
Copy link
Member

Not finished yet. View state bounds is broken for the viewstate event, I'll also add util functions to retrieve these values from the input (so input[[magic_string]] isn't required)

@anthonynorth anthonynorth reopened this Mar 16, 2022
anthonynorth added a commit that referenced this issue Mar 16, 2022
- add additional viewstate fields
- bounds outside viewstate object
- add R functions for retrieving event data
@anthonynorth
Copy link
Member

I've added getter utilities for retrieving event data from the map in shiny.

The magic string approach will still work, but consider that to be a private api. Event names and payload structure may change in future.

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

No branches or pull requests

2 participants