r-spatial / mapview

Interactive viewing of spatial data in R
https://r-spatial.github.io/mapview/
GNU General Public License v3.0
515 stars 91 forks source link

Not rendering in shiny. #398

Closed williamlai2 closed 2 years ago

williamlai2 commented 2 years ago

For example:

library(shiny)
library(shinydashboard)
library(mapview)

ui <- dashboardPage(
  dashboardHeader(title = "test"),
  dashboardSidebar(),
  dashboardBody(
    mapviewOutput("map")
  )
)

server <- function(input, output) {
  output$map <- renderMapview({
    mapview(breweries)
  })
}

shinyApp(ui, server)

Produces:

Error in exprToQuo(expr, env, quoted = TRUE) : Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected

See issue here: https://community.rstudio.com/t/mapview-no-longer-renders-in-shiny/117110

> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252    LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
[5] LC_TIME=English_Australia.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] mapview_2.10.0       shinydashboard_0.7.2 shiny_1.7.0
tim-salabim commented 2 years ago

Please see https://github.com/r-spatial/mapview/issues/399#issuecomment-940754510