<?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: Saving points while drawing a polygon in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444496#M41054</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your map's spatial reference is Web Mercator or Geographic, you can use the geographicGeometry property of the onDrawComplete event.&amp;nbsp; This will return the XY coordinates in lat/long.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;console.log(geometry.geographicGeometry.rings);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When creating a triangle you should get 4 points.&amp;nbsp; The 4th point will be a duplicate of the first point.&amp;nbsp; When you digitizing, double-click the 3rd point and the triangle will auto-complete.&amp;nbsp; If you are trying to close the triangle yourself by double-clicking on the 4th point, it will create a 5th point unless you are exactly clicking on the starting point.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Apr 2013 09:39:57 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2013-04-24T09:39:57Z</dc:date>
    <item>
      <title>Saving points while drawing a polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444493#M41051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I downloaded the sample cod: Add graphics to a map&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/graphics_add.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/graphics_add.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to save the points (lat and lon)&amp;nbsp; of a polygon as its being drawn or at "ondrawend"&amp;nbsp;&amp;nbsp; and get a list of all the points.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Not a free style line drawing,&amp;nbsp; just a straight line polygon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the function addGraphic (geometry)&amp;nbsp;&amp;nbsp; is there&amp;nbsp;&amp;nbsp; a way to do this&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var points[] =&amp;nbsp; geometry.getPoints();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to save the points to a jsonstore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank You&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 18:16:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444493#M41051</guid>
      <dc:creator>RichardDeVita</dc:creator>
      <dc:date>2013-04-23T18:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Saving points while drawing a polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444494#M41052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Richard,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could use the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/jsapi/draw.html#onDrawComplete" rel="nofollow noopener noreferrer" target="_blank"&gt;onDrawComplete&lt;/A&gt;&lt;SPAN&gt; event to do this.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dojo.connect(tb, "onDrawComplete", function(geometry){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(geometry.geometry.rings);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:52:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444494#M41052</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T19:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Saving points while drawing a polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444495#M41053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank You.&amp;nbsp; This is a start.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ran this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; console.log(geometry.rings);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;got this&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[[[-13459684.212552793, 4676535.610062524], [-13453282.61143392, 4673535.456702335], [-13459588.666267438, 4670917.488483570], 2 more...]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;how do I convert these numbers to latitude and longitude ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also I drew a triangle,&amp;nbsp; but I get 5 points ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank You for the help&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 19:24:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444495#M41053</guid>
      <dc:creator>RichardDeVita</dc:creator>
      <dc:date>2013-04-23T19:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: Saving points while drawing a polygon</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444496#M41054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If your map's spatial reference is Web Mercator or Geographic, you can use the geographicGeometry property of the onDrawComplete event.&amp;nbsp; This will return the XY coordinates in lat/long.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;console.log(geometry.geographicGeometry.rings);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When creating a triangle you should get 4 points.&amp;nbsp; The 4th point will be a duplicate of the first point.&amp;nbsp; When you digitizing, double-click the 3rd point and the triangle will auto-complete.&amp;nbsp; If you are trying to close the triangle yourself by double-clicking on the 4th point, it will create a 5th point unless you are exactly clicking on the starting point.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 09:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/saving-points-while-drawing-a-polygon/m-p/444496#M41054</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-04-24T09:39:57Z</dc:date>
    </item>
  </channel>
</rss>

