Add a Sidebar Leaflet Control
The sidebar plugin only works in a reactive environment (e.g Shiny), as the
HTML must be created by using sidebar_tabs and
sidebar_pane and it must be created before
leafletOutput.
addSidebar(map, id = "sidebar", options = list(position = "left", fit = TRUE))
map |
A leaflet map widget |
id |
Id of the sidebar-div. Must match with the |
options |
A named list with |
the new map object
Other Sidebar Functions:
closeSidebar(),
openSidebar(),
removeSidebar(),
sidebar_pane(),
sidebar_tabs()
## Not run:
library(shiny)
runApp(paste0(system.file("examples", package = "leaflet.extras2"),
"/sidebar_app.R"))
## End(Not run)Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.