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

Toggle Basemap in Shiny #223

Open
lspoletini-d3 opened this issue May 30, 2024 · 0 comments
Open

Toggle Basemap in Shiny #223

lspoletini-d3 opened this issue May 30, 2024 · 0 comments

Comments

@lspoletini-d3
Copy link

lspoletini-d3 commented May 30, 2024

Hello. I'm wondering if there is a way to switch between basemaps using Shiny buttons.

Currently, the below works great for my interactivity needs dealing with polygon and scatterplot layers.

observeEvent( input$someinput, {
deckgl_proxy("mymap") %>%
add_x_layer(...) %>%
add_y_layer(...) %>%
update_deckgl (it="works")
})

However, attempting something similar with add_basemap() results in no change. The only workaround I have found is calling renderDeckgl() anew each time I want to use a Shiny button to change the basemap, which I'd like to avoid. In JS this appears to be related to setProps (?).

@lspoletini-d3 lspoletini-d3 changed the title Change MapStyle using Shiny buttons Toggle Basemap in Shiny May 30, 2024
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

1 participant