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
-
SidebarInstance of a sidebar.
Source
Methods
_addButton(titleopt, className, container) → {object}
Add a button
Parameters
-
title
string<optional>
Title of the button.
-
className
stringClass name of the button.
-
container
objectElement containing the button.
Returns
-
objectNew 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
stringElement id of the tab pane (and part of the tab id).
-
className
stringClass name of the tab.
-
title
string<optional>
Title of the tab.
-
content
objectElement 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
-
objectThe newly created tab pane.
Source
addTabList() → {object}
Add sidebar tab list.
Returns
-
objectTab list element.
Source
addTo(map) → {Sidebar}
Add this sidebar to the specified map.
Parameters
-
map
L.MapLeaflet map the control is to be added to.
Returns
-
SidebarThe sidebar (this).
Source
close() → {Sidebar}
Close the sidebar (if necessary).
Returns
-
SidebarThe sidebar (this).
Source
open(id) → {Sidebar}
Open sidebar (if necessary) and show the specified tab.
Parameters
-
id
stringThe id of the tab to show (without the # character)
Returns
-
SidebarThe sidebar (this).
Source
removeFrom(map) → {Sidebar}
Remove this sidebar from the map.
Parameters
-
map
L.MapLeaflet map the control had been added to.
Returns
-
SidebarThe sidebar (this).
Source
toggle()
Collapse/Expand the sidebar.