<?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 Newbie Polygon Question in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/newbie-polygon-question/m-p/202505#M4738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a question about Adobe Flex ActionScript and Polygon object. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this simple form with 8 text fields that I used to enter 4 point coordinates (x and y values for each) to draw Polygon on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There's an example included with Flex APIs for Polygon object that I was trying to follow but something isn't working for me....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The example shows how to do this in MXML, not Actionscript so I was wondering if you guys know how to make this working in Actionscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I have so far:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The function this code is in takes variable number of arguments so first I'm looping through it to get my array of MapPoints&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var rectangle:Polygon = new Polygon();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var sr:SpatialReference = new SpatialReference(4326);//&amp;lt;-- this number comes from example I have no idea what it means&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rectangle.spatialReference = sr;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// points are :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//1. x="13" y="55.59"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//2. x="18.42" y="-33.92"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//3. x="-43.23" y="-22.90"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//4. x="13" y="55.59"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//they will appear West of Africa and I see them but not the polygon created out of them. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var j:uint = 0; j &amp;lt; args.length; j++){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; argArray.push(args&lt;J&gt;);&lt;/J&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rectangle.addRing(argArray);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//create new graphic to add to graphicsLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic = new Graphic(polyLine);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic.symbol = new SimpleLineSymbol(lineStyle.selectedItem.style, cpLine.selectedColor, numLineAlpha.value, numLineWidth.value);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic.attributes = {labeled: isMeasurementExpanded};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphicsLayer.add(graphic);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2012 23:10:24 GMT</pubDate>
    <dc:creator>GregoryBoratyn</dc:creator>
    <dc:date>2012-08-16T23:10:24Z</dc:date>
    <item>
      <title>Newbie Polygon Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/newbie-polygon-question/m-p/202505#M4738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a question about Adobe Flex ActionScript and Polygon object. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have this simple form with 8 text fields that I used to enter 4 point coordinates (x and y values for each) to draw Polygon on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There's an example included with Flex APIs for Polygon object that I was trying to follow but something isn't working for me....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The example shows how to do this in MXML, not Actionscript so I was wondering if you guys know how to make this working in Actionscript.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what I have so far:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The function this code is in takes variable number of arguments so first I'm looping through it to get my array of MapPoints&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var rectangle:Polygon = new Polygon();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var sr:SpatialReference = new SpatialReference(4326);//&amp;lt;-- this number comes from example I have no idea what it means&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rectangle.spatialReference = sr;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;// points are :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//1. x="13" y="55.59"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//2. x="18.42" y="-33.92"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//3. x="-43.23" y="-22.90"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//4. x="13" y="55.59"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//they will appear West of Africa and I see them but not the polygon created out of them. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var j:uint = 0; j &amp;lt; args.length; j++){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; argArray.push(args&lt;J&gt;);&lt;/J&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rectangle.addRing(argArray);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//create new graphic to add to graphicsLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic = new Graphic(polyLine);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic.symbol = new SimpleLineSymbol(lineStyle.selectedItem.style, cpLine.selectedColor, numLineAlpha.value, numLineWidth.value);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic.attributes = {labeled: isMeasurementExpanded};&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphicsLayer.add(graphic);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 23:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/newbie-polygon-question/m-p/202505#M4738</guid>
      <dc:creator>GregoryBoratyn</dc:creator>
      <dc:date>2012-08-16T23:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie Polygon Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/newbie-polygon-question/m-p/202506#M4739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greg,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Well first what 4326 means is that is the WKID (Well Known ID) number for the WGS 1984 geographic spatial reference find more info here: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/flex-api/concepts/017p/017p0000001p000000.htm"&gt;http://resources.arcgis.com/en/help/flex-api/concepts/017p/017p0000001p000000.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It may help to see more of your code for getting the values from your simple for and putting them in the args variable.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it may be as simple as asking if you have added your first point to the point array at the end to close the polygon?..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2012 01:46:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/newbie-polygon-question/m-p/202506#M4739</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-08-17T01:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie Polygon Question</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/newbie-polygon-question/m-p/202507#M4740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks rscheitlin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code I'm showing in my first post is pretty much what I have. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I found my mistake. It's one of those, "copy/paste" mistakes... &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The two line of code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic = new Graphic(polyLine);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic.symbol = new SimpleLineSymbol(lineStyle.selectedItem.style, cpLine.selectedColor, numLineAlpha.value, numLineWidth.value);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;should actually be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic = new Graphic(rectangle);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphic.symbol = new SimpleFillSymbol(lineStyle.selectedItem.style, cpLine.selectedColor, numLineAlpha.value, numLineWidth.value);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully someone else will benefit from this thread.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Greg&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Aug 2012 19:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/newbie-polygon-question/m-p/202507#M4740</guid>
      <dc:creator>GregoryBoratyn</dc:creator>
      <dc:date>2012-08-20T19:50:38Z</dc:date>
    </item>
  </channel>
</rss>

