AnsweredAssumed Answered

ArcGIS JS 4.6 StreamLayer Graphics Array Access

Question asked by dana.conway on Feb 28, 2018
Latest reply on Mar 1, 2018 by dana.conway

Using the ArcGIS JS 4.4 API, I was able to access a StreamLayer's graphics with this snippet (in this case, I'm removing the graphics):




We have upgraded to the 4.6 API.   The documentation states that you can still access it that way, but is undefined when you examine it in the debugger, and the graphics are not being removed from the layer 

I realize that I can use the queryGraphics method, but I was unsuccessful in removing the graphics from the layer in this manner.



      layerView.queryGraphics().then( function(graphics) {

      console.log(“Num graphics: “ + graphics.length);

      graphics.removeAll();   // DOES NOT WORK




Using the browser debugger to examine the properties in the layerView, I saw that there were 2 options that ended up working to clear the graphics.  But, these 2 properties are not mentioned in the documentation, so I'm not quite sure what they are supposed to be used for.   These two were:;  and;


Does anyone know the correct way to access the StreamLayer's graphics array in the 4.6 API?   Are either of these acceptable?