Hello
I am trying to query my feature layer when it gets loaded. I found this method on the esri website:
// returns all the graphics from the layer view
view.whenLayerView(layer).then(function(layerView){
layerView.watch("updating", function(val){
if(!val){ // wait for the layer view to finish updating
layerView.queryFeatures().then(function(results){
console.log(results); // prints all the client-side features to the console
});
}
});
});
But this queries through all the features everytime layer gets updated(like dragging, zooming etc.). I just want to query once when it gets loaded. Can someone please help me out with this?
Thanks in advanced