Select to view content in your preferred language

Select Feature from graphic argis api javacript 4.7

2125
2
04-23-2018 07:29 AM
ACCDVermont
New Contributor II

How might I go about selecting a feature layer from a graphic like 'promises.push(featureLayer1.selectFeatures(query, FeatureLayer.SELECTION_NEW));'  in 4.7

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

You use code like this:

featureLayer1.selectFeatures(query, FeatureLayer.SELECTION_NEW, function(fs){
  //fs is not the featureset from the select features method
});
0 Kudos
UndralBatsukh
Esri Regular Contributor

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 

0 Kudos