<?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: Can not update graphic color (SketchWidget, v4.18) - Bug? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1029329#M71837</link>
    <description>&lt;P&gt;Thanks for the response, which I have accepted as a solution. However, please note that in previous versions it was possible to update a symbol color for the &lt;EM&gt;current graphic&lt;/EM&gt; by using the approach shown in my original post, and it is only with v4.18 that this approach no longer works.&lt;BR /&gt;&lt;BR /&gt;I'm not sure if this was intended change for v4.18 based on release documentation (..I could have overlooked something) and therefore I suspect this is a bug?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Feb 2021 09:46:43 GMT</pubDate>
    <dc:creator>parmsang</dc:creator>
    <dc:date>2021-02-23T09:46:43Z</dc:date>
    <item>
      <title>Can not update graphic color (SketchWidget, v4.18) - Bug?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1028938#M71829</link>
      <description>&lt;P&gt;Since upgrading to 4.18, it seems the ability to update graphic symbol properties is not working when using the Sketch widget.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you checkout the codepen for the following Sketch widget &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-geometries/" target="_self"&gt;sample&lt;/A&gt;&amp;nbsp;and listen to update events, and then try to set the color of the graphic, it does not work.&lt;/P&gt;&lt;P&gt;The basic code I added to the codepen was this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;      sketch.on("update", function(event) {
        if (event.state === 'complete') {
          event.graphics[0].symbol.set('color', [226, 119, 40]);
          console.log(event.graphics[0])
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;This worked in 4.17, and can be proven in the above sample by editing to use ArcGIS JS version 4.17.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 15:41:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1028938#M71829</guid>
      <dc:creator>parmsang</dc:creator>
      <dc:date>2021-02-21T15:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can not update graphic color (SketchWidget, v4.18) - Bug?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1029177#M71833</link>
      <description>&lt;P&gt;What is the goal of the above task? The code tries to change the symbol of the graphic, which at that time is a reference to the internal symbol used by the Sketch widget, so all subsequent graphics created via the Sketch widget will use the updated symbol.&amp;nbsp; Is that what you want to do?&amp;nbsp; If so, check out the 'polygonSymbol' property of the SketchViewModel as it might be an alternate approach.&amp;nbsp; If the goal is to change the symbol for just the current graphic after it has been added to the layer, you'll can instead clone and update the symbol (so you don't change the Sketch internal symbol).&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/john-grayson/pen/zYoEJbQ" target="_blank"&gt;https://codepen.io/john-grayson/pen/zYoEJbQ&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 16:42:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1029177#M71833</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2021-02-22T16:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can not update graphic color (SketchWidget, v4.18) - Bug?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1029329#M71837</link>
      <description>&lt;P&gt;Thanks for the response, which I have accepted as a solution. However, please note that in previous versions it was possible to update a symbol color for the &lt;EM&gt;current graphic&lt;/EM&gt; by using the approach shown in my original post, and it is only with v4.18 that this approach no longer works.&lt;BR /&gt;&lt;BR /&gt;I'm not sure if this was intended change for v4.18 based on release documentation (..I could have overlooked something) and therefore I suspect this is a bug?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 09:46:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1029329#M71837</guid>
      <dc:creator>parmsang</dc:creator>
      <dc:date>2021-02-23T09:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Can not update graphic color (SketchWidget, v4.18) - Bug?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1029695#M71841</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;John's suggestion is spot on. You have to replace the entire symbol or clone it when you are updating the Graphic's symbol. It was working at 4.17 by "accident". In any case, I will update the Graphic.symbol document to indicate that needs to be cloned and reassigned to the graphic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2021 19:14:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/can-not-update-graphic-color-sketchwidget-v4-18/m-p/1029695#M71841</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-02-23T19:14:09Z</dc:date>
    </item>
  </channel>
</rss>

