Constructor
new ToolboxController(toolList)
Parameters:
Name | Type | Description |
---|---|---|
toolList | object | The list of tool objects. |
Classes
Methods
bindLayerGroup(layerGroup, layer)
Listen to layer interaction events.
Parameters:
Name | Type | Description |
---|---|---|
layerGroup | LayerGroup | The associated layer group. |
layer | ViewLayer | | The layer to listen to. |
enableShortcuts(flag)
Enable or disable shortcuts. The 'init' methods enables shortcuts by default. Call this method after init to disable shortcuts.
Parameters:
Name | Type | Description |
---|---|---|
flag | boolean | True to enable shortcuts. |
getSelectedTool() → {object}
Get the selected tool.
Returns:
The selected tool.
- Type:
- object
getSelectedToolEventHandler(eventType) → {function}
Get the selected tool event handler.
Parameters:
Name | Type | Description |
---|---|---|
eventType | string | The event type, for example mousedown, touchstart... |
Returns:
The event handler.
- Type:
- function
getToolList() → {Array}
Get the tool list.
Returns:
The list of tool objects.
- Type:
- Array
hasTool(name) → {boolean}
Check if a tool is in the tool list.
Parameters:
Name | Type | Description |
---|---|---|
name | string | The name to check. |
Returns:
The tool list element for the given name.
- Type:
- boolean
init()
Initialise.
setSelectedTool(name)
Set the selected tool.
Parameters:
Name | Type | Description |
---|---|---|
name | string | The name of the tool. |
setToolFeatures(list)
Set the selected tool live features.
Parameters:
Name | Type | Description |
---|---|---|
list | object | The list of features. |