Skip to content

Toggle Basemap in Shiny #223

@lspoletini-d3

Description

@lspoletini-d3

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 (?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions