<?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: Correct method for sending graphics array for reproject in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/correct-method-for-sending-graphics-array-for/m-p/287194#M6857</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert, helpful as always.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This still feels a little hokey to me. I basically had to guess that myXYGraphicsLayer.graphicProvider returned an array collection. It's kind of obvious but if I had to guess here I'm worried that there are other places down the line that it won't be obvious.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I like your way of using the "as ArrayCollection;" declaration during the assignment. Its a little more structured.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Jul 2010 15:39:24 GMT</pubDate>
    <dc:creator>DrewDowling</dc:creator>
    <dc:date>2010-07-28T15:39:24Z</dc:date>
    <item>
      <title>Correct method for sending graphics array for reproject</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/correct-method-for-sending-graphics-array-for/m-p/287192#M6855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need to send a collection of points to a geometry service for reprojection. The points are in a graphics layer from when the users clicked on the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the code I am using is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var arraycollhope:Object;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arraycollhope = myXYGraphicsLayer.graphicProvider&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var outSR:SpatialReference = new SpatialReference(2230);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;geometry1.project(arraycollhope.toArray(), outSR);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where myXYGraphicsLayer is the graphics layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This seems to work but what i don't understand why. arraycollhope is defined as an object not as an array collection. If I define it as an array collection I get an implicit conversion error as myXYGraphicsLayer.graphicProvider returns an object. Yet when I call the method .toArray it appears to work, even though this isn't a method on IObject. To me this implies an implicit conversion anyway.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there another preferred way of doing this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for any help or comments&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 04:16:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/correct-method-for-sending-graphics-array-for/m-p/287192#M6855</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2010-07-28T04:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: Correct method for sending graphics array for reproject</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/correct-method-for-sending-graphics-array-for/m-p/287193#M6856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Drew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; The way that you are doing it is fine. The graphicProvider of a graphicsLayer return value is type object (normally that object is an array collection). You could do&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var arraycollhope:ArrayCollection;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arraycollhope = myXYGraphicsLayer.graphicProvider&amp;nbsp; as ArrayCollection;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The project method is expecting and Array (not ArrayCollection) so that is why you have to use&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arraycollhope.toArray()&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 13:25:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/correct-method-for-sending-graphics-array-for/m-p/287193#M6856</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2010-07-28T13:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Correct method for sending graphics array for reproject</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/correct-method-for-sending-graphics-array-for/m-p/287194#M6857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert, helpful as always.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This still feels a little hokey to me. I basically had to guess that myXYGraphicsLayer.graphicProvider returned an array collection. It's kind of obvious but if I had to guess here I'm worried that there are other places down the line that it won't be obvious.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I like your way of using the "as ArrayCollection;" declaration during the assignment. Its a little more structured.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Jul 2010 15:39:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/correct-method-for-sending-graphics-array-for/m-p/287194#M6857</guid>
      <dc:creator>DrewDowling</dc:creator>
      <dc:date>2010-07-28T15:39:24Z</dc:date>
    </item>
  </channel>
</rss>

