if (FALSE) {
map <- mapboxgl(
style = mapbox_style("streets"),
center = c(-74.006, 40.7128),
zoom = 10,
access_token = "your_mapbox_access_token"
)
# Update the map style in a Shiny app
observeEvent(input$change_style, {
mapboxgl_proxy("map", session) %>%
set_style(mapbox_style("dark"), config = list(showLabels = FALSE), diff = TRUE)
})
}
Run the code above in your browser using DataLab