import { find } from "@arcgis/core/rest/find.js";const { find } = await $arcgis.import("@arcgis/core/rest/find.js");- Since
- ArcGIS Maps SDK for JavaScript 4.19
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 method. The result will be an instance of FindResult.
Known Limitations
The find operation is currently not supported if attempting to be used: in a 3D SceneView with dynamic layers
Type definitions
FindResults
results
- Type
- FindResult[]
An array of objects containing the result features of the find() method.
Functions
| Name | Return Type | Object |
|---|---|---|
| | |
| |
find
Sends a request to the ArcGIS REST map service resource to perform a search based on the input parameters.
- Signature
-
find (url: string, parameters: FindParameters | FindParametersProperties, requestOptions?: RequestOptions): Promise<FindResults>
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| url | URL to the ArcGIS Server REST resource that represents a map service. | | |
| parameters | Specifies the layers and fields that are used for the search. | | |
| requestOptions | Additional options to be used for the data request. | |
- Returns
- Promise<FindResults>
Example
let parameters = new FindParameters({ layerIds: [0], searchFields: ["areaname"], outSpatialReference: { wkid: 4326 }, returnGeometry: true});find(url, parameters).then(function(results){ // Results contain FindResults of search});