Class: MarkerManager

Constructor

MarkerManager

new MarkerManager(workspace)

Class to manage the multiple markers and the cursor on a workspace.

Parameter

workspace

Blockly.WorkspaceSvg

The workspace for the marker manager.

Value must not be null.

Methods

dispose

package

dispose()

Dispose of the marker manager. Go through and delete all markers associated with this marker manager.

getCursor

getCursor() returns Blockly.Cursor

Get the cursor for the workspace.

Returns

Blockly.Cursor The cursor for this workspace.

getMarker

getMarker(id) returns Blockly.Marker

Get a single marker that corresponds to the given id.

Parameter

id

string

A unique identifier for the marker.

Returns

Blockly.Marker The marker that corresponds to the given id, or null if none exists.

registerMarker

registerMarker(id, marker)

Register the marker by adding it to the map of markers.

Parameter

id

string

A unique identifier for the marker.

marker

Blockly.Marker

The marker to register.

Value must not be null.

setCursor

setCursor(cursor)

Sets the cursor and initializes the drawer for use with keyboard navigation.

Parameter

cursor

Blockly.Cursor

The cursor used to move around this workspace.

setCursorSvg

package

setCursorSvg(cursorSvg)

Add the cursor svg to this workspace svg group.

Parameter

cursorSvg

SVGElement

The svg root of the cursor to be added to the workspace svg group.

setMarkerSvg

package

setMarkerSvg(markerSvg)

Add the marker svg to this workspaces svg group.

Parameter

markerSvg

SVGElement

The svg root of the marker to be added to the workspace svg group.

unregisterMarker

unregisterMarker(id)

Unregister the marker by removing it from the map of markers.

Parameter

id

string

The id of the marker to unregister.