Hide Table of Contents
esri
Map
toolbars
Class: IdentifyTask
[ AMD Module Require | Legacy Module Require ]

Module Require

require(["esri/tasks/IdentifyTask", ... ], function(IdentifyTask, ... ){ ... });

Description

Performs an identify operation on the layers of a map service resource exposed by the ArcGIS Server REST API.

Samples

Search for samples that use this class.

Class hierarchy

esri.tasks.IdentifyTask

Constructors

ConstructorDescription
new IdentifyTask(url,options?)Creates a new IdentifyTask object. A URL is a required parameter.

Properties

PropertyTypeDescription
urlStringURL to the ArcGIS Server REST resource that represents a map service. To obtain the URL, use Services Directory.

Methods

MethodReturn ValueDescription
execute(identifyParameters,callback?,errback?)dojo.DeferredSends a request to the ArcGIS REST map service resource to identify features based on the IdentifyParameters specified in the identifyParameters argument. On completion, the onComplete event is fired and the optional callback function is invoked.

Events

[ On Style Events | Connect Style Events ]

All On Style event listeners receive a single event object. The event properties listed below are accessed from this event object. Additionally, the event object also contains a 'target' property whose value is the object which fired the event.
On EventEvent PropertiesDescription
complete<IdentifyResult[]> resultsFires when the identify operation is complete. Should be used in favor of onComplete.
Constructor Details

new IdentifyTask(url,options?)

Creates a new IdentifyTask object. A URL is a required parameter.
Parameters:
<String> urlRequiredURL to the ArcGIS Server REST resource that represents a map service. An example is http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer. For more information on constructing a URL, see The Services Directory and the REST API.
<Object> optionsOptionalOptional parameters. See options list.
Options:
<String> gdbVersionSpecify the geodatabase version to display. (As of v2.7). Requires ArcGIS Server service 10.1 or greater
Code Snippet:
require([
  "esri/tasks/IdentifyTask", ... 
], function(IdentifyTask, ... ) {
  var identify = new IdentifyTask("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/MapServer");
  ...
});
Property Details

<String> url

URL to the ArcGIS Server REST resource that represents a map service. To obtain the URL, use Services Directory.
Method Details

execute(identifyParameters,callback?,errback?)

Sends a request to the ArcGIS REST map service resource to identify features based on the IdentifyParameters specified in the identifyParameters argument. On completion, the onComplete event is fired and the optional callback function is invoked.

The return object of dojo.Deferred was added at v1.4.
Return Value: dojo.Deferred
Input Parameters:
<IdentifyParameters> identifyParametersRequiredSpecifies the criteria used to identify the features.
<Function> callbackOptionalThe function to call when the method has completed. The arguments in the function are the same as the onComplete event.
<Function> errbackOptionalAn error object is returned if an error occurs on the Server during task execution. (As of v1.3)
Code Snippet:
identifyParams.geometry = geometry;
identifyParams.mapExtent = map.extent;
identify.execute(identifyParams);
See Also: onComplete  onError
Event Details

[ On Style Events | Connect Style Events ]

complete

Fires when the identify operation is complete. Should be used in favor of onComplete.
Event Properties:
<IdentifyResult[]> resultsThe result of an identify operation