<?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: Cannot update SketchViewModel polygonSymbol using Esri Loader in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-update-sketchviewmodel-polygonsymbol-using/m-p/1182802#M77671</link>
    <description>&lt;P&gt;So, I found a work around to this. Apparently the polygon tool does not use the polygonSymbol for symbology, but the polyLINESymbol when using ESRI loader. No clue why this is or how to target the inside patterning, but being able to modify the lines will suffice.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jun 2022 17:07:08 GMT</pubDate>
    <dc:creator>JT_Salfer</dc:creator>
    <dc:date>2022-06-14T17:07:08Z</dc:date>
    <item>
      <title>Cannot update SketchViewModel polygonSymbol using Esri Loader</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-update-sketchviewmodel-polygonsymbol-using/m-p/1180455#M77612</link>
      <description>&lt;P&gt;I've encountered some pretty strange behavior trying to adjust the viewModel of the Sketch Widget.&amp;nbsp;&lt;BR /&gt;Following&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sketch-viewmodel-styler/#overriding-symbology" target="_blank" rel="noopener"&gt;this tutorial&lt;/A&gt;&amp;nbsp;for the&amp;nbsp;SketchViewModel Styler, I've attempted to add in a custom polygonSymbol using the SketchViewModel. It works...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JT_Salfer_3-1654552175087.gif" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42854iED279B9018738866/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JT_Salfer_3-1654552175087.gif" alt="JT_Salfer_3-1654552175087.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;...to a point. It works fine with the rectangle and circle tools, but it will not work for the polygon tool until the sketch is finished, which is ultimately the what I want to target.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JT_Salfer_4-1654552298992.gif" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42855i9D1E97C601C977CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JT_Salfer_4-1654552298992.gif" alt="JT_Salfer_4-1654552298992.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I can confirm this is happening in different versions of the API (4.19, 4.23), but I'm only seeing it in projects that use Esri Loader. I can create a new project that does not call the Sketch Widget or SketchViewModel via Esri Loader and it works fine. The code below is what I'm using for the sketch widget's viewModel. You can take the exact same code, plug it into&amp;nbsp;the live demo at&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-geometries" target="_self"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=sketch-geometries&lt;/A&gt;&amp;nbsp;, and everything works as expected. The only reason I can see why this doesn't work as expected with the freehand polygon tool the way that I'm doing it is due to the presence of Esri Loader. Does anyone have a possible work around for this issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;    let sketchWidget = new Sketch({
        view,
        layer: sketchLayer,
        creationMode: "single",
        availableCreateTools,
        viewModel: new SketchViewModel({
          view: view,
          layer: sketchLayer,
          polygonSymbol: {
            type: "simple-fill",
            style: "cross",
            color: "#EFC8B1",
            outline: {
              width: 3,
              style: "solid",
              color: "red",
            },
          },
        }),
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 02:48:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-update-sketchviewmodel-polygonsymbol-using/m-p/1180455#M77612</guid>
      <dc:creator>JT_Salfer</dc:creator>
      <dc:date>2022-06-07T02:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot update SketchViewModel polygonSymbol using Esri Loader</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-update-sketchviewmodel-polygonsymbol-using/m-p/1182802#M77671</link>
      <description>&lt;P&gt;So, I found a work around to this. Apparently the polygon tool does not use the polygonSymbol for symbology, but the polyLINESymbol when using ESRI loader. No clue why this is or how to target the inside patterning, but being able to modify the lines will suffice.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2022 17:07:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-update-sketchviewmodel-polygonsymbol-using/m-p/1182802#M77671</guid>
      <dc:creator>JT_Salfer</dc:creator>
      <dc:date>2022-06-14T17:07:08Z</dc:date>
    </item>
  </channel>
</rss>

