Handles

AMD: require(["esri/core/Handles"], (Handles) => { /* code goes here */ });
ESM: import Handles from "@arcgis/core/core/Handles";
Class: esri/core/Handles
Since: ArcGIS Maps SDK for JavaScript 4.7

This class helps manage a group of handles.

Method Overview

Name Return Type Summary Class

Adds a group of handles.

more details
Handles

Destroys the object, removing all the handles.

more details
Handles
Boolean

Returns true if a group exists for the provided group key, false otherwise.

more details
Handles

Removes a group of handles.

more details
Handles

Removes all handles.

more details
Handles

Method Details

add(handles, groupKey)

Adds a group of handles.

Parameters

An array or collection handles to group.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Handles.remove(). If no key is provided the handles are added to a default group.

Example
let handles = new Handles();

handles.add(handle); // added to the default group
handles.add([handle1, handle2]); // added to the default group

handles.add(handle, "handle-group");
handles.add([handle1, handle2], "other-handle-group");
destroy()

Destroys the object, removing all the handles.

has(groupKey){Boolean}

Returns true if a group exists for the provided group key, false otherwise.

Parameter
groupKey *

group handle key

Returns
Type Description
Boolean
remove(groupKey)

Removes a group of handles.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
let handles = new Handles();

handles.remove(); // removes handles from default group

handles.remove("handle-group");
handles.remove("other-handle-group");
removeAll()

Removes all handles.

Type Definitions

Handle

A handle to a highlight call result. The handle can be used to remove the installed highlight.

Property
remove Function

Removes the handle.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.