Select to view content in your preferred language

Get existing graphics on featurelayer?

2955
12
05-11-2018 10:38 AM
ShawnCastrianni
Emerging Contributor

In the old versions, a FeatureLayer extended GraphicsLayer such that I could directly access the graphics on a loaded feature layer from URL.  That no longer seems to be the case.  If I wanted to loop through all the graphics on a feature layer, how would I do that?  I don't want to call QueryFeatures as I think that goes back to the server.  They have already been loaded from the server and are visible on the map.

0 Kudos
12 Replies
dotMorten_esri
Esri Notable Contributor

There are lots of sample services here: http://sampleserver6.arcgisonline.com/arcgis/rest

0 Kudos
dotMorten_esri
Esri Notable Contributor

One more thing... you can also select features directly with a query as shown here:

FeatureLayer.SelectFeaturesAsync Method (QueryParameters, SelectionMode) 

0 Kudos
ShawnCastrianni
Emerging Contributor

That works!  I will go with this, but I should still write a test program since the other way did not work.