Search a map service exposed by the ArcGIS Server REST API based on a string value. The search can be conducted on a single field of a single layer, on many fields of a layer, or on many fields of many layers.
Use FindParameters to set the parameters of the task. The result will be an instance of FindResult.
Known Limitations
FindTask is currently not supported if attempting to be used:
- in a 3D SceneView
- with dynamic layers
- See also:
Constructors
-
new FindTask(properties)
-
Parameter:properties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
Name | Type | Summary | Class | |
---|---|---|---|---|
String | more details The name of the class. | more details | Accessor | |
String | more details Specify the geodatabase version to search. | more details | FindTask | |
String | more details URL to the ArcGIS Server REST resource that represents a map service. | more details | FindTask |
Property Details
-
Since: ArcGIS API for JavaScript 4.7
-
The name of the class. The declared class name is formatted as
esri.folder.className
.
-
gdbVersion String
-
Specify the geodatabase version to search. Requires ArcGIS Server service 10.1 or greater.
-
url String
-
URL to the ArcGIS Server REST resource that represents a map service.
Method Overview
Name | Return Type | Summary | Class | |
---|---|---|---|---|
Promise<Object> | more details Sends a request to the ArcGIS REST map service resource to perform a search based on the input params. | more details | FindTask |
Method Details
-
Sends a request to the ArcGIS REST map service resource to perform a search based on the input params.
Parameters:Autocasts from ObjectSpecifies the layers and fields that are used for the search.
requestOptions ObjectoptionalAdditional options to be used for the data request.
Returns:Type Description Promise<Object> Resolves to an object with the following properties: Property Type Description results FindResult[] An array of objects containing the result features of the Find task. exceededTransferLimit Boolean exceededTransferLimit is included in the response only if the result exceeded the transfer limit. Example:require([ "esri/tasks/support/FindParameters", "esri/tasks/FindTask", ... ], function(FindParameters, FindTask, ... ) { let params = new FindParameters({ layerIds: [0], searchFields: ["areaname"], outSpatialReference: { wkid: 4326 }, returnGeometry: true }); let findTask = new FindTask( ... ); findTask.execute(params).then(function(results){ // Results contain FindResults of search }); ... });