How might I go about selecting a feature layer from a graphic like 'promises.push(featureLayer1.selectFeatures(query, FeatureLayer.SELECTION_NEW));' in 4.7
Hi there,
You can use FeatureLayerView.queryFeatures + FeatureLayerView.highlight methods to replace FeatureLayer.selectFeatures.
Here are couple of samples to show you how this can be done:
Query features from a FeatureLayerView | ArcGIS API for JavaScript 4.7
Highlight features by geometry | ArcGIS API for JavaScript 4.7
You use code like this:
featureLayer1<SPAN class="punctuation token">.</SPAN><SPAN class="token function">selectFeatures</SPAN><SPAN class="punctuation token">(</SPAN>query<SPAN class="punctuation token">,</SPAN> FeatureLayer<SPAN class="punctuation token">.</SPAN>SELECTION_NEW<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN><SPAN class="punctuation token">(</SPAN>fs<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">//fs is not the featureset from the select features method</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.