Class: ToolsOptions

Mapspace.control. ToolsOptions

An object to manage default options for tools.


new ToolsOptions( [opt_options])

Parameters:
Name Type Argument Description
opt_options Object <optional>

Options.

Source:
mapspace/controls/toolsoptions.js

Extends

  • ol.Object

Methods


getButton(toolname, parent, icon, appended, showText, classNames)

Returns the HTML element with a button for a given tool.

Parameters:
Name Type Argument Description
toolname Mapspace.ToolNames

The tool name.

parent HTMLElement

The parent element for the button.

icon string <nullable>

Optional icon name from Mapspace.html.icons to use instead of the one defined for the tool. It does not matter if it is uppercase or lowercase.

appended boolean <nullable>

Optional. If true the button is for being appended at the end of an input-group. By default is false.

showText boolean <nullable>

Optional. If true the tooltip text is used as text in the button. By default is false.

classNames string <nullable>

Optional. If provided then these will class names used.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
HTMLElement

getCursor(toolname)

Returns the cursor of the viewer viewport for the given tool or when no tool is selected passing null.

Parameters:
Name Type Description
toolname Mapspace.ToolNames

The tool name.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
string

getDropdownButton(toolname, parent)

Returns the HTML element with a button inside a dropdown for a given tool.

Parameters:
Name Type Description
toolname Mapspace.ToolNames

The tool name.

parent HTMLElement

The parent element for the button.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
HTMLElement

getDropdownMenu(toolname, parent)

Returns the HTML element with a menu inside a dropdown for a given tool.

Parameters:
Name Type Description
toolname Mapspace.ToolNames

The tool name.

parent HTMLElement

The parent element for the button.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
HTMLElement

getHelpMessage(toolname, viewType)

Returns the HTML fragment to show a help message for a given tool or an empty string if the tool do not exists. If tool name is null then the default 'No tool' help message is returned.

Parameters:
Name Type Argument Description
toolname Mapspace.ToolNames <nullable>

The tool name.

viewType Mapspace.ViewType

The type of viewer in which show the help.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
string

getIcon(toolname)

Returns the HTML string fragment with an SVG icon for the given tool or null if the tool do not exists.

Parameters:
Name Type Description
toolname Mapspace.ToolNames

The tool name.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
string

getListItemButton(toolname, parent [, floatRight], icon)

Returns the HTML element with a button inside a list item for a given tool.

Parameters:
Name Type Argument Description
toolname Mapspace.ToolNames

The tool name.

parent HTMLElement

The parent element for the button.

floatRight boolean <optional>

An optional param indicating if button must float right or not. By default is true.

icon string <nullable>

An optional icon. If set then a no-change-icon classname is added and the icon used is the one passed.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
HTMLElement

getOptions(toolname)

Returns the default options object for a given tool or null if tool do not exists.

Parameters:
Name Type Description
toolname Mapspace.ToolNames

The tool name.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
Mapspace.ToolDefinition

getTooltip(toolname, element [, placement])

Returns a tooltip for the given tool. Returns null if currently the platform is mobile.

Parameters:
Name Type Argument Description
toolname Mapspace.ToolNames

The tool name.

element HTMLElement <nullable>

An optional element to which attach the tooltip.

placement Mapspace.control.TooltipPlacement <optional>

An optional placement for the tooltip. By default is BOTTOM.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
Mapspace.control.Tooltip

getTooltipText(toolname)

Returns the tooltip text for the given tool or empty string if tool not exists. If tool name is null then the default 'No tool' tooltip is returned.

Parameters:
Name Type Argument Description
toolname Mapspace.ToolNames <nullable>

The tool name.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
string

getVisibility(toolname, workspace, viewer, control)

Returns the visibility of the given tool for the workspace, viewer, control and current user passed as params.

Parameters:
Name Type Description
toolname Mapspace.ToolNames

The tool name.

workspace Mapspace.Workspace

The current workspace.

viewer Mapspace.Viewer

The viewer to check visibility for.

control Mapspace.control.Control

The control to check visibility for.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
boolean

isInteractive(toolname)

Returns true if the given tool is an interactive tool.

Parameters:
Name Type Description
toolname Mapspace.ToolNames

The tool name.

Source:
mapspace/controls/toolsoptions.js
Returns:
Type
boolean