ToolboxController

Toolbox controller.

Constructor

new ToolboxController(toolList)

Parameters:
NameTypeDescription
toolListobject

The list of tool objects.

Classes

ToolboxController

Methods

bindLayer(layer, layerGroupDivId)

Listen to layer interaction events.

Parameters:
NameTypeDescription
layerobject

The layer to listen to.

layerGroupDivIdstring

The associated layer group div id.

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.