ToolboxController

Toolbox controller.

Constructor

new ToolboxController(toolList)

Parameters:
NameTypeDescription
toolListobject

The list of tool objects.

Classes

ToolboxController

Methods

bindLayerGroup(layerGroup, layer)

Listen to layer interaction events.

Parameters:
NameTypeDescription
layerGroupLayerGroup

The associated layer group.

layerViewLayer | DrawLayer

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:
NameTypeDescription
flagboolean

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:
NameTypeDescription
eventTypestring

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:
NameTypeDescription
namestring

The name to check.

Returns:

The tool list element for the given name.

Type: 
boolean

init()

Initialise.

setSelectedTool(name)

Set the selected tool.

Parameters:
NameTypeDescription
namestring

The name of the tool.

setToolFeatures(list)

Set the selected tool live features.

Parameters:
NameTypeDescription
listobject

The list of features.