Constructor
new SidePanel()
- Source:
Example
import { SidePanel } from 'ol-side-panel';
const sidePanel = new SidePanel();
map.addControl(sidePanel);
const layersPane = sidePanel.definePane({
paneId: 'layers',
name: "Layers",
icon: '<i class="bi bi-layers-half"></i>'
});
const layersGreeting = document.createElement('p');
layersGreeting.innerHTML = "Hi there layers!";
layersPane.addWidgetElement(layersGreeting);
Extends
Methods
addWidgetElement(paneId, widgetElement) → {SidePanelWidget}
- Source:
Add an HTML element to the named pane as a new SidePanelWidget.
Parameters:
Name | Type | Description |
---|---|---|
paneId |
String | The identifier of the pane to add the widget to. |
widgetElement |
external:Element |
Returns:
A reference to the newly added widget.
- Type
- SidePanelWidget
definePane(args) → {SidePanelPane}
- Source:
Defines a new pane.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
args |
Object | pane args
Properties
|
Returns:
A reference to the newly defined pane.
- Type
- SidePanelPane
getPaneById(paneId) → {SidePanelPane}
- Source:
Get the pane with the specified identifier.
Parameters:
Name | Type | Description |
---|---|---|
paneId |
String | The identifier of the pane to get - this is the same identifier that was passed into definePane. |
Returns:
A reference to the pane.
- Type
- SidePanelPane
removePaneById(paneId)
- Source:
Remove the pane with the specified identifier.
Parameters:
Name | Type | Description |
---|---|---|
paneId |
String | The identifier of the pane to remove - this is the same identifier that was passed into definePane. |
setMap(map)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
map |
external:Map | The OpenLayers map instance this control is being added to. |