Class: ToolActivateMgr service:ngeoToolActivateMgr

ngeo.misc.ToolActivateMgr

new ToolActivateMgr($rootScope)

Provides a service to manage the activation of ngeo.misc.ToolActivate objects.

Example:

Each tool must be registered before using it.

let tool = new ngeo.misc.ToolActivate(interaction, 'active');
ngeoToolActivateMgr.registerTool('mapTools', tool);

A tool will be registered in a group identified by a group name. Once registered a tool can be activated and deactivated. When activating a tool, all others tools in the same group will be deactivated.

ngeoToolActivateMgr.activateTool(tool);
ngeoToolActivateMgr.deactivateTool(tool);

See our live examples: ../examples/mapquery.html ../examples/toolActivate.html

Parameters:
Name Type Description
$rootScope angular.Scope

The rootScope provider.

Methods

activateTool(tool)

Activate a tool.

Parameters:
Name Type Description
tool ngeo.misc.ToolActivate

Tool to activate.

deactivateTool(tool)

Deactivate a tool.

Parameters:
Name Type Description
tool ngeo.misc.ToolActivate

Tool to deactivate.

registerTool(groupName, tool, [opt_defaultActivate]opt)

Register a tool.

Parameters:
Name Type Attributes Description
groupName string

Name of the group of this tool.

tool ngeo.misc.ToolActivate

Tool to register.

[opt_defaultActivate] boolean= <optional>

If true, this tool will be activated when all other tools in the group are deactivated.

unregisterGroup(groupName)

Unregister each tool from a group.

Parameters:
Name Type Description
groupName string

Name of the group of tools to unregister.

unregisterTool(groupName, tool)

Unregister a tool from a group.

Parameters:
Name Type Description
groupName string

Name of the group of this tool.

tool ngeo.misc.ToolActivate

Tool to unregister.