<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ArcGIS JS 4.6 StreamLayer Graphics Array Access in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-4-6-streamlayer-graphics-array-access/m-p/583154#M54469</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I spoke with ESRI and they confirmed that &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;layerView.graphics.removeAll()&lt;/SPAN&gt; throws an error in version 4.6 of the API.&amp;nbsp; It is fixed in the in-progress 4.7 API, but since that is not released yet, they said to use&lt;SPAN style="font-family: courier new,courier,monospace;"&gt; layerView.&lt;STRONG&gt;controller&lt;/STRONG&gt;.graphics.removeAll();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Mar 2018 17:40:06 GMT</pubDate>
    <dc:creator>DanaConway</dc:creator>
    <dc:date>2018-03-01T17:40:06Z</dc:date>
    <item>
      <title>ArcGIS JS 4.6 StreamLayer Graphics Array Access</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-4-6-streamlayer-graphics-array-access/m-p/583153#M54468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; font-size: 13px;"&gt;Using the&amp;nbsp;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):&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace; font-size: 13px;"&gt;mapView.whenLayerView(streamLayer)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; .then(function(layerView){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: yellow;"&gt;layerView.graphics.removeAll();&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace; font-size: 13px;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-size: 13px;"&gt;We&amp;nbsp;have upgraded to the 4.6 API.&amp;nbsp;&amp;nbsp; The documentation states that you can still access it that way, but &lt;SPAN&gt;layerView.graphics is undefined when you examine it in the debugger, and the graphics are not being removed from the layer&lt;/SPAN&gt;.&amp;nbsp; &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-StreamLayerView.html#graphics&lt;/A&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-size: 13px;"&gt;I realize that I can use the queryGraphics method, but I was unsuccessful in removing the graphics from the layer in this manner.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-size: 13px; font-family: courier new,courier,monospace;"&gt;mapView.whenLayerView(streamLayer)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-family: courier new,courier,monospace; font-size: 13px;"&gt;&amp;nbsp;&amp;nbsp; .then(function(layerView){&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #1f497d; font-size: medium; font-family: Calibri;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: courier new,courier,monospace;"&gt;layerView.queryGraphics().then( function(graphics) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(“Num graphics: “ + graphics.length);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphics.removeAll();&amp;nbsp;&amp;nbsp; // DOES NOT WORK&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: courier new,courier,monospace;"&gt;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-size: 13px; font-family: courier new,courier,monospace;"&gt;});&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="color: #000000; font-size: medium; font-family: Times New Roman;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;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.&amp;nbsp; But, these 2 properties are not&amp;nbsp;mentioned in the documentation, so I'm not quite sure what they are supposed to be used for.&amp;nbsp;&amp;nbsp; These two were:&amp;nbsp; &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;layerView.&lt;SPAN style="background: yellow;"&gt;featuresView&lt;/SPAN&gt;.graphics.removeAll&lt;/SPAN&gt;();&amp;nbsp; and&lt;SPAN style="font-family: courier new,courier,monospace;"&gt; layerView.&lt;SPAN style="background: yellow;"&gt;controller&lt;/SPAN&gt;.graphics.removeAll();&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: arial,helvetica,sans-serif;"&gt;Does anyone know the correct way to access the StreamLayer's graphics array in the 4.6 API?&amp;nbsp;&amp;nbsp; Are either of these acceptable?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2018 22:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-4-6-streamlayer-graphics-array-access/m-p/583153#M54468</guid>
      <dc:creator>DanaConway</dc:creator>
      <dc:date>2018-02-28T22:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS JS 4.6 StreamLayer Graphics Array Access</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-4-6-streamlayer-graphics-array-access/m-p/583154#M54469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I spoke with ESRI and they confirmed that &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;layerView.graphics.removeAll()&lt;/SPAN&gt; throws an error in version 4.6 of the API.&amp;nbsp; It is fixed in the in-progress 4.7 API, but since that is not released yet, they said to use&lt;SPAN style="font-family: courier new,courier,monospace;"&gt; layerView.&lt;STRONG&gt;controller&lt;/STRONG&gt;.graphics.removeAll();&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2018 17:40:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/arcgis-js-4-6-streamlayer-graphics-array-access/m-p/583154#M54469</guid>
      <dc:creator>DanaConway</dc:creator>
      <dc:date>2018-03-01T17:40:06Z</dc:date>
    </item>
  </channel>
</rss>

