The sidebar HTML must be created with sidebar_tabs
and
sidebar_pane
before
leafletOutput
is called.
addSidebar(map, id = "sidebar", options = list(position = "left"), ns = NULL)
A leaflet map widget
Id of the sidebar-div. Must match with the id
of
sidebar_tabs
A named list with the only option position
, which should
be either left
or right
.
The namespace function, if used in Shiny modules.
the new map
object
Other Sidebar Functions:
closeSidebar()
,
openSidebar()
,
removeSidebar()
,
sidebar_pane()
,
sidebar_tabs()
if (FALSE) {
library(shiny)
# run example app showing a single sidebar
runApp(paste0(system.file("examples", package = "leaflet.extras2"),
"/sidebar_app.R"))
# run example app showing two sidebars
runApp(paste0(system.file("examples", package = "leaflet.extras2"),
"/multi_sidebar_app.R"))
}