Identify returns features filtered by definitionExpression

364
1
02-10-2021 05:05 AM
cmarco77c
New Contributor II

Hi,

we're developing a custom solution based on Javascript ESRI  4.x  and we have configured this viewer to hide some featuers based on user criteria, using the layer definitionExpression feature.

Features on map are showing correctly, based onthe filter value, but if we create an IdentifyTask, this will get any feature in the map regardless it's filtered or not.

So we get a filtered map view but user can anyway identify hidden objects on the layer.

How can we deal with this to get Identify working only on non filtered objects on the layers ?

 

Kind regards

Marco

0 Kudos
1 Reply
cmarco77c
New Contributor II

I think I found the (bad) answer here :

https://community.esri.com/t5/arcgis-api-for-javascript/how-to-filter-by-attributes-in-identifytask-...

 

4.x API is missing a useful option (layerDefinitions ) in identifyParameters, so unfortunately we have to filter manually the result in the identify result function.

marco

0 Kudos