<?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 Using the draw polygon, the isSelfIntersecting bool is only true after vertex-add but not draw-complete in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1177359#M77478</link>
    <description>&lt;P&gt;Using the draw polygon (&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-PolygonDrawAction.html#event-draw-complete" target="_self"&gt;PolygonDrawAction&lt;/A&gt;), the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting" target="_self"&gt;isSelfIntersecting&lt;/A&gt; bool is only true after vertex-add but not draw-complete.&amp;nbsp; So if I draw a polygon and create a self intersecting polygon, if I just double click ie draw-complete event the&amp;nbsp; isSelfIntersecting bool stays false.&amp;nbsp; I need to add a vertex ie&amp;nbsp;vertex-add after I draw a self intersecting polygon and then double click to draw complete and then the&amp;nbsp;isSelfIntersecting bool is set to true.&amp;nbsp; so my question is there a way to force a vertex-add at the draw-complete location or do I need to evaluate the vertices and find the self intersecting geometry manually by evaluating the vertices?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dogWater73_1-1653674066862.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42346i5AA2934CDB36F49B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dogWater73_1-1653674066862.png" alt="dogWater73_1-1653674066862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dogWater73_0-1653674040914.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42345iFCBB0B83861772B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dogWater73_0-1653674040914.png" alt="dogWater73_0-1653674040914.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 17:54:50 GMT</pubDate>
    <dc:creator>dogWater73</dc:creator>
    <dc:date>2022-05-27T17:54:50Z</dc:date>
    <item>
      <title>Using the draw polygon, the isSelfIntersecting bool is only true after vertex-add but not draw-complete</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1177359#M77478</link>
      <description>&lt;P&gt;Using the draw polygon (&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-draw-PolygonDrawAction.html#event-draw-complete" target="_self"&gt;PolygonDrawAction&lt;/A&gt;), the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#isSelfIntersecting" target="_self"&gt;isSelfIntersecting&lt;/A&gt; bool is only true after vertex-add but not draw-complete.&amp;nbsp; So if I draw a polygon and create a self intersecting polygon, if I just double click ie draw-complete event the&amp;nbsp; isSelfIntersecting bool stays false.&amp;nbsp; I need to add a vertex ie&amp;nbsp;vertex-add after I draw a self intersecting polygon and then double click to draw complete and then the&amp;nbsp;isSelfIntersecting bool is set to true.&amp;nbsp; so my question is there a way to force a vertex-add at the draw-complete location or do I need to evaluate the vertices and find the self intersecting geometry manually by evaluating the vertices?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dogWater73_1-1653674066862.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42346i5AA2934CDB36F49B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dogWater73_1-1653674066862.png" alt="dogWater73_1-1653674066862.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dogWater73_0-1653674040914.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42345iFCBB0B83861772B3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dogWater73_0-1653674040914.png" alt="dogWater73_0-1653674040914.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 17:54:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1177359#M77478</guid>
      <dc:creator>dogWater73</dc:creator>
      <dc:date>2022-05-27T17:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using the draw polygon, the isSelfIntersecting bool is only true after vertex-add but not draw-complete</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1178100#M77513</link>
      <description>&lt;P&gt;From your description, this appears to be a bug, but you shouldn't necessarily have to go through the effort of manually checking the vertices yourself.&amp;nbsp; One possible workaround may be to &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Polygon.html#clone" target="_self"&gt;clone&lt;/A&gt; the polygon, and check the property of the cloned object.&amp;nbsp; Another workaround may be to call one or both of the following on the original geometry:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;geometry.notifyChange("rings");
geometry.notifyChange("isSelfIntersecting");&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 20:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1178100#M77513</guid>
      <dc:creator>JoelBennett</dc:creator>
      <dc:date>2022-05-27T20:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using the draw polygon, the isSelfIntersecting bool is only true after vertex-add but not draw-complete</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1178602#M77534</link>
      <description>&lt;P&gt;the clone is still identified as&amp;nbsp;isSelfIntersecting: false&lt;/P&gt;&lt;P&gt;I will keep looking into your suggestions. Thank you!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dogWater73_0-1654010264046.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/42453iEDB584CA0BDEC023/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dogWater73_0-1654010264046.png" alt="dogWater73_0-1654010264046.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 15:19:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1178602#M77534</guid>
      <dc:creator>dogWater73</dc:creator>
      <dc:date>2022-05-31T15:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using the draw polygon, the isSelfIntersecting bool is only true after vertex-add but not draw-complete</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1178774#M77536</link>
      <description>&lt;P&gt;OK so I just check to see if the polygon isSimple&amp;nbsp; on draw complete and it is not .isSelfIntersecting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt; function that checks if the polygon intersects itself&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;isSelfIntersecting&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;polygon&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt; &lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt; The quickest way to see if the poly is selfintersecting with out the esri .isSelfIntersecting bool is to check to see if the poly is simple&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;isSimplePoly&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;polygon&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;geometry&lt;/SPAN&gt;&lt;SPAN&gt; as __esri.&lt;/SPAN&gt;&lt;SPAN&gt;Polygon&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt; Avoids TypeScript errors when building the app&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;this&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;esriLibrary&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;GeometryEngine&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;isSimple&lt;/SPAN&gt;&lt;SPAN&gt;(isSimplePoly)) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;true&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt; Return true if the Polygon is Simple&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt; &lt;SPAN&gt;false&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN&gt;//&lt;/SPAN&gt;&lt;SPAN&gt;Return false if it is not simple&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; };&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 31 May 2022 20:37:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-draw-polygon-the-isselfintersecting-bool/m-p/1178774#M77536</guid>
      <dc:creator>dogWater73</dc:creator>
      <dc:date>2022-05-31T20:37:16Z</dc:date>
    </item>
  </channel>
</rss>

