<?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: Drawing multiple Polygons in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1381282#M83626</link>
    <description>&lt;P&gt;This codepen shows how to draw polygons using SketchViewModel:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/WNmYRrV?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/U_B_U/pen/WNmYRrV?editors=1000&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2024 20:34:38 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2024-02-12T20:34:38Z</dc:date>
    <item>
      <title>Drawing multiple Polygons</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1380710#M83616</link>
      <description>&lt;P&gt;Hi everyone, I am trying to draw multiple polygons on the map. I'm able to draw them but I cant not see the vertices or the outline.&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;LI-CODE lang="javascript"&gt;          let drawnPolygons = [];

          document.getElementById("drawPolygon").onclick = () =&amp;gt; {
            if (
              document.getElementById("tradereport3").style.display == "none"
            ) {
              document.getElementById("tradereport3").style.display = "block";
            }
            document.getElementById("tradereport1").style.display = "none";
            document.getElementById("tradereport2").style.display = "none";
            document.getElementById("tradereport4").style.display = "none";
            const action = draw.create("polygon");

            action.on(
              [
                "vertex-add",
                "vertex-remove",
                "cursor-update",
                "redo",
                "undo",
                "draw-complete",
              ],
              PolygonVertices
            )


          };
          function PolygonVertices(event) { 
            if (event.type === "draw-complete" &amp;amp;&amp;amp; event.vertices.length &amp;gt; 1) {
              const result = createPolygon(event);
              drawnPolygons.push(result)
              PolygonBufferGeom()

            }
          }

          function createPolygon(event) {
            const vertices = event.vertices;

            const graphicpoly = new Graphic({
              geometry: {
                type: "polygon",
                rings: [vertices],
                spatialReference: view.spatialReference,
              },
              symbol: {
                type: "simple-fill",
                color: [234, 136, 8, 0.1],
                outline: {
                  color: [234, 136, 8, 10],
                  width: 1,
                },
              },
            });
            view.graphics.add(graphicpoly);
            return graphicpoly
          }&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;'If I don't do e&lt;SPAN&gt;vent&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;type&lt;/SPAN&gt;&lt;SPAN&gt; === &lt;/SPAN&gt;&lt;SPAN&gt;"draw-complete, my polygons end up following the cursor movement, like this;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Charan_0-1707540963349.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/94386iEDCD9EF96E4B1685/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Charan_0-1707540963349.png" alt="Charan_0-1707540963349.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/6522"&gt;@JoelBennett&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/507049"&gt;@Sage_Wall&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Feb 2024 23:33:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1380710#M83616</guid>
      <dc:creator>Charan</dc:creator>
      <dc:date>2024-02-10T23:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing multiple Polygons</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1381147#M83624</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please clarify what the issue is here? I am not clear on what the end goal is.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 16:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1381147#M83624</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2024-02-12T16:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing multiple Polygons</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1381223#M83625</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;so when Im drawing the polygons I cant see the shape of the polygon until I finish it off, but if i remove event.tuype=="drawing" i can see the polygons while drawing but they are being created based on cursor movement&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 19:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1381223#M83625</guid>
      <dc:creator>Charan</dc:creator>
      <dc:date>2024-02-12T19:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: Drawing multiple Polygons</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1381282#M83626</link>
      <description>&lt;P&gt;This codepen shows how to draw polygons using SketchViewModel:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/WNmYRrV?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/U_B_U/pen/WNmYRrV?editors=1000&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 20:34:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/drawing-multiple-polygons/m-p/1381282#M83626</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2024-02-12T20:34:38Z</dc:date>
    </item>
  </channel>
</rss>

