How to filter by attributes in IdentifyTask() in ArcGIS JS 4.6 api?

905
4
Jump to solution
07-05-2018 11:41 AM
vishwasuppoor1
New Contributor II

I am using IdentifyTask() on a feature layer to show popups of feature points when the map is clicked. However, I need to be able to display popups for only those feature points which have a certain attribute value (eg. popups for those with the attribute {status:"Active"} should be displayed, but for those with {status:"Inactive"} should not be displayed). I could not find any properties in IdentifyParameters() which would allow me to do that. The current workaround I am using is filtering for the attributes from the returned results. But I am wondering if there is a way to specify the filter parameters within IdentifyParameters(). What I am looking is something like the where property in Query().

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Vishwas,

   The 4.x api does not have a layerDefinitions property like the 3.x api had:

https://developers.arcgis.com/javascript/3/jsapi/identifyparameters-amd.html#layerdefinitions 

So for now filtering the results like you are is the best solution.

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Vishwas,

   The 4.x api does not have a layerDefinitions property like the 3.x api had:

https://developers.arcgis.com/javascript/3/jsapi/identifyparameters-amd.html#layerdefinitions 

So for now filtering the results like you are is the best solution.

vishwasuppoor1
New Contributor II

Robert,

Thanks for the response. Can't we use requestOptions constructor of IdentifyTask()? The requestOptions object has a query property, but there are no samples which demonstrate it being used. I might have misunderstood the functionality of requestOptions. TIA

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Vishwas,

   No requestOptions property is for something else completely and is documented in this link:

https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#RequestOptions 

0 Kudos
ChristopherCorliss1
New Contributor II

Are there any plans to add the layerDefinitions property to Identify Parameters in the future for v4?

0 Kudos