Class: LinestringToolbar

OSDPaperjsAnnotation.LinestringTool.LinestringToolbar(linestringTool)

The LinestringToolbar class extends the AnnotationUIToolbarBase and provides the toolbar controls for the LinestringTool. The constructor initializes the LinestringToolbar by calling the base class (AnnotationUIToolbarBase) constructor and sets up the necessary toolbar controls.

Constructor

new LinestringToolbar(linestringTool)

Create a new LinestringToolbar instance. The constructor initializes the LinestringToolbar by calling the base class (AnnotationUIToolbarBase) constructor and sets up the necessary toolbar controls.
Parameters:
Name Type Description
linestringTool OSDPaperjsAnnotation.LinestringTool The LinestringTool instance associated with the toolbar.
Properties:
Name Type Description
rangeInput jQuery The range input element for adjusting the brush radius in the toolbar.
eraseButton jQuery The erase button element in the toolbar for toggling erase mode.
Source:

Extends

  • AnnotationUIToolbarBase

Methods

isEnabledForMode(mode) → {boolean}

Check if the LinestringTool should be enabled for the current mode. The isEnabledForMode function is called to determine if the LinestringTool should be enabled for the current mode. It returns true if the mode is 'new', 'LineString', or 'MultiLineString', and false otherwise.
Parameters:
Name Type Description
mode string The current mode of the tool.
Source:
Returns:
- A boolean value indicating whether the LinestringTool should be enabled for the current mode.
Type
boolean

setEraseMode(erasing)

Set the erase mode for the LinestringTool. The setEraseMode function is called when the user clicks the erase button in the LinestringToolbar. It sets the erase mode of the associated LinestringTool based on the value of the erasing parameter. If erasing is true, it enables the erase mode in the LinestringTool by adding the 'active' class to the erase button. If erasing is false, it disables the erase mode by removing the 'active' class from the erase button.
Parameters:
Name Type Description
erasing boolean A boolean value indicating whether the erase mode should be enabled or disabled.
Source:

updateBrushRadius(update)

Update the brush radius based on the mouse wheel scroll direction. The updateBrushRadius function is called when the user scrolls the mouse wheel in the LinestringToolbar. It updates the brush radius value based on the direction of the mouse wheel scroll. If the larger property of the update object is true, it increases the brush radius. If the larger property of the update object is false, it decreases the brush radius.
Parameters:
Name Type Description
update Object An object containing the update information.
Properties
Name Type Description
larger boolean A boolean value indicating whether the brush radius should be increased or decreased.
Source: