I can't seem to get compare() working in a Shiny app. I've tried to make a minimal reproducible example here. It gives the error: Warning in renderWidget(instance) : Ignoring explicitly provided widget ID "compare-container-db634"; Shiny doesn't use them.
# Load libraries
library(shiny)
library(mapgl)
# Define UI
ui <- fluidPage(
titlePanel("Map Comparison"),
mainPanel(
mapboxglOutput("compare_map", height = "800px")
)
)
# Define Server logic
server <- function(input, output, session) {
output$compare_map <- renderMapboxgl({
m1 <- mapboxgl(style = mapbox_style("light"))
m2 <- mapboxgl(style = mapbox_style("dark"))
# Use the compare function as documented
compare(m1, m2)
})
}
# Run the application
shinyApp(ui = ui, server = server)
compare() doesn't work in Shiny yet. Because of how it's structured it's technically a separate HTMLwidget that would need its own render function. I'd like to get this working eventually!
Hello,
I can't seem to get compare() working in a Shiny app. I've tried to make a minimal reproducible example here. It gives the error:
Warning in renderWidget(instance) : Ignoring explicitly provided widget ID "compare-container-db634"; Shiny doesn't use them
.