Can I programmatically select a feature using 4.x?

328
1
07-12-2018 10:03 AM
JasonBrowning
New Contributor

I'm trying to create a "zoom to" function for a list of features that are in a popup related to a currently selected "parent" feature. I can zoom to the feature just fine, but I don't know how to select it. So...given lat/long, is there a way to select a feature? I know 3.x had a selectFeatures function, but I'm not sure if that or something similar exists in 4.x. If not, is there another way to do it? Do I just need to programmatically click the map at the lat/long coordinates and make sure I'm in the right layer? Any assistance is greatly appreciated!

-Jason

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Jason,

   Highlighting a feature in 4.x is still not fully supported but look at this link:

https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.htm... 

If you are not asking about highlighting a feature on the map and just want to show it's popup then you would do a query on the layer using the lat/lon to create a point as the queries geometry and then set the views popup using the returned feature.

0 Kudos