Closed hdmm3 closed 11 months ago
I think this is related to https://github.com/SymbolixAU/mapdeck/issues/373 - will fully test when that's resolved
reader: not solved by #373
example:
library(shiny)
library(shinydashboard)
library(mapdeck)
set_token(secret::get_secret("MAPBOX"))
ui <- dashboardPage(
dashboardHeader()
, dashboardSidebar(
shiny::actionButton(
inputId = "btn"
, label = "update view"
)
)
, dashboardBody(
mapdeckOutput(
width = "100%"
, height = "800px"
, outputId = "map"
)
)
)
server <- function(input, output) {
output$map <- renderMapdeck({
mapdeck(style = mapdeck_style("light"))
})
observeEvent(input$btn, {
mapdeck_update(map_id = "map") %>%
mapdeck_view(pitch = 60, transition = "linear", duration = 500)
})
}
shinyApp(ui = ui, server = server)
needed to check for empty location
array (as well as null
)
I was trying to update the map view using
mapdeck_view
in my shiny app to change the pitch, without changing the location like this:However, doing this throws console errors in the browser and freezes/crashes the map. Assuming this behaviour wasn't considered for
mapdeck_view
, would it be possible to add it? Alternatively, is there a workaround to do this?I'm using the latest Github version of the package.