Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

addSidebar

Add a Sidebar Leaflet Control


Description

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.

Usage

addSidebar(map, id = "sidebar", options = list(position = "left", fit = TRUE))

Arguments

map

A leaflet map widget

id

Id of the sidebar-div. Must match with the id of sidebar_tabs

options

A named list with position and fit elements.

Value

the new map object

References

See Also

Other Sidebar Functions: closeSidebar(), openSidebar(), removeSidebar(), sidebar_pane(), sidebar_tabs()

Examples

## Not run: 
library(shiny)
runApp(paste0(system.file("examples", package = "leaflet.extras2"),
              "/sidebar_app.R"))

## End(Not run)

leaflet.extras2

Extra Functionality for 'leaflet' Package

v1.1.0
GPL-3 | file LICENSE
Authors
Gatscha Sebastian [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.