new Sidebar(optionsopt) → {Sidebar}
Create a new sidebar.
Parameters
-
options
object
<optional>
Options.
Properties
-
title
string
<optional>
'Toggle advanced menu'Title of the panel.
-
position
'left'
|'right'
<optional>
'left'Position of the sidebar.
-
collapsed
boolean
<optional>
trueSidebar initially in closed position?
-
forceSeparateButton
boolean
<optional>
falseSidebar button separate from zoom control?
-
title
Returns
-
Sidebar
Instance of a sidebar.
Source
Methods
_addButton(titleopt, className, container) → {object}
Add a button
Parameters
-
title
string
<optional>
Title of the button.
-
className
string
Class name of the button.
-
container
object
Element containing the button.
Returns
-
object
New link (button) element.
Source
_onClick()
Actions performed when clicking on the sidebar toggle button.
Source
_onCloseClick()
Actions performed when clicking on the sidebar close button.
Source
addTab(id, className, titleopt, content, sideClassopt) → {object}
Add sidebar tab and its pane.
Parameters
-
id
string
Element id of the tab pane (and part of the tab id).
-
className
string
Class name of the tab.
-
title
string
<optional>
Title of the tab.
-
content
object
Element containing the tab content.
-
sideClass
string
<optional>
Class name of an additional element which may be opened or close in parallel to the tab.
Returns
-
object
The newly created tab pane.
Source
addTabList() → {object}
Add sidebar tab list.
Returns
-
object
Tab list element.
Source
addTo(map) → {Sidebar}
Add this sidebar to the specified map.
Parameters
-
map
L.Map
Leaflet map the control is to be added to.
Returns
-
Sidebar
The sidebar (this).
Source
close() → {Sidebar}
Close the sidebar (if necessary).
Returns
-
Sidebar
The sidebar (this).
Source
open(id) → {Sidebar}
Open sidebar (if necessary) and show the specified tab.
Parameters
-
id
string
The id of the tab to show (without the # character)
Returns
-
Sidebar
The sidebar (this).
Source
removeFrom(map) → {Sidebar}
Remove this sidebar from the map.
Parameters
-
map
L.Map
Leaflet map the control had been added to.
Returns
-
Sidebar
The sidebar (this).
Source
toggle()
Collapse/Expand the sidebar.