<?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 How to create a closed polyline? in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/how-to-create-a-closed-polyline/m-p/786213#M899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say I want to create a rectangle polyline that is closed. I start my line, create lines to each new point, but then how to close? the code I thought would be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newLine.startPath( x, y);&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.lineTo(x1, y1) //next coordinate&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.lineTo(x2, y2) //etc&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.lineTo(x3, y3)&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.closePathWithLine(); // OR the next line...&lt;/P&gt;&lt;P&gt; newLine.closeAllPaths();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("is the new waterway closed? ", newLine.isClosedPath(0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the close path lines of code cause the isClosedPath property to change to true, but the actual polyline is only three sides, the fourth closing line is (as per the documentation below) not a actual line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;A closed path has a virtual segment that connects the last and the first points of the path. The first point is not duplicated to close the path.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;I tried adding a line of code at the end to draw a line back to the starting point:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;newLine.lineTo(x, y)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;If I include this line WITHOUT any closePath lines of code, it creates a four sided polyline but it is not "closed". If I include this last line of code plus also the code to closePath - it seems to only create three sides again.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;How to create a polyline that DOES have all four sides including one back to the start point, but is closed?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;-Paul&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Sep 2015 05:45:10 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2015-09-16T05:45:10Z</dc:date>
    <item>
      <title>How to create a closed polyline?</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/how-to-create-a-closed-polyline/m-p/786213#M899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say I want to create a rectangle polyline that is closed. I start my line, create lines to each new point, but then how to close? the code I thought would be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;newLine.startPath( x, y);&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.lineTo(x1, y1) //next coordinate&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.lineTo(x2, y2) //etc&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.lineTo(x3, y3)&lt;/P&gt;&lt;P&gt;&amp;nbsp; newLine.closePathWithLine(); // OR the next line...&lt;/P&gt;&lt;P&gt; newLine.closeAllPaths();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("is the new waterway closed? ", newLine.isClosedPath(0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both the close path lines of code cause the isClosedPath property to change to true, but the actual polyline is only three sides, the fourth closing line is (as per the documentation below) not a actual line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;A closed path has a virtual segment that connects the last and the first points of the path. The first point is not duplicated to close the path.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;I tried adding a line of code at the end to draw a line back to the starting point:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;newLine.lineTo(x, y)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;If I include this line WITHOUT any closePath lines of code, it creates a four sided polyline but it is not "closed". If I include this last line of code plus also the code to closePath - it seems to only create three sides again.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;How to create a polyline that DOES have all four sides including one back to the start point, but is closed?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Roboto, sans-serif;"&gt;-Paul&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Sep 2015 05:45:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/how-to-create-a-closed-polyline/m-p/786213#M899</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2015-09-16T05:45:10Z</dc:date>
    </item>
  </channel>
</rss>

