<?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: creating a graphic layer from another feature layer in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694999#M15526</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A Graphic is a Flash DisplayObject so it can only exist in one container at a time. You'll need to create separate instances if you want them to exist in both layers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Jan 2011 19:06:10 GMT</pubDate>
    <dc:creator>DasaPaddock</dc:creator>
    <dc:date>2011-01-10T19:06:10Z</dc:date>
    <item>
      <title>creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694995#M15522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a feature layer and it shows polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i want to create another graphic layer from the above .. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to use graphiclayer.graphicprovider = featurelayer.graphicprovider , but it did not work.. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried creating a deep copy of the arraycollection of the featurelayer and then use that as the graphiclayer graphicprovider&amp;nbsp; but that did not work&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way of creating this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 15:24:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694995#M15522</guid>
      <dc:creator>abukhan</dc:creator>
      <dc:date>2011-01-10T15:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694996#M15523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Abu,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; This code worked for me:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;
&amp;lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:s="library://ns.adobe.com/flex/spark" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:mx="library://ns.adobe.com/flex/mx" 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:esri="http://www.esri.com/2008/ags"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; minWidth="955" minHeight="600"&amp;gt;
 &amp;lt;fx:Script&amp;gt;
&amp;nbsp; &amp;lt;![CDATA[
&amp;nbsp;&amp;nbsp; import com.esri.ags.events.LayerEvent;
&amp;nbsp;&amp;nbsp; import com.esri.ags.layers.GraphicsLayer;
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; import mx.collections.ArrayCollection;
&amp;nbsp;&amp;nbsp; import mx.controls.Alert;

&amp;nbsp;&amp;nbsp; // the following four functions are 'just' error handling and showing/hiding the busy cursor
&amp;nbsp;&amp;nbsp; protected function fLayer_updateStartHandler(event:LayerEvent):void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; this.cursorManager.setBusyCursor();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; protected function fLayer_updateEndHandler(event:LayerEvent):void
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var ac:ArrayCollection = fLayer.graphicProvider as ArrayCollection;
&amp;nbsp;&amp;nbsp;&amp;nbsp; var gl:GraphicsLayer = new GraphicsLayer();
&amp;nbsp;&amp;nbsp;&amp;nbsp; gl.graphicProvider = ac;
&amp;nbsp;&amp;nbsp;&amp;nbsp; myMap.addLayer(gl);
&amp;nbsp;&amp;nbsp;&amp;nbsp; fLayer.visible = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; this.cursorManager.removeBusyCursor();
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; ]]&amp;gt;
 &amp;lt;/fx:Script&amp;gt;
 &amp;lt;esri:Map id="myMap"&amp;gt;
&amp;nbsp; &amp;lt;esri:extent&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;esri:Extent xmin="-14305000" ymin="2748000" xmax="-6815000" ymax="7117000"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;esri:SpatialReference wkid="102100"/&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;lt;/esri:Extent&amp;gt;
&amp;nbsp; &amp;lt;/esri:extent&amp;gt;
&amp;nbsp; &amp;lt;esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Physical_Map/MapServer"/&amp;gt;
&amp;nbsp; &amp;lt;esri:FeatureLayer id="fLayer"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mode="snapshot"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateEnd="fLayer_updateEndHandler(event)"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; updateStart="fLayer_updateStartHandler(event)"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSFields/FeatureServer/0"/&amp;gt;
 &amp;lt;/esri:Map&amp;gt;
&amp;lt;/s:Application&amp;gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:14:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694996#M15523</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694997#M15524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks robert..yes it works..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Abu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 18:51:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694997#M15524</guid>
      <dc:creator>abukhan</dc:creator>
      <dc:date>2011-01-10T18:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694998#M15525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;However it looks like the feature layer does not show (even though you make fLayer visible and gl not visible)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 19:02:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694998#M15525</guid>
      <dc:creator>abukhan</dc:creator>
      <dc:date>2011-01-10T19:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694999#M15526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A Graphic is a Flash DisplayObject so it can only exist in one container at a time. You'll need to create separate instances if you want them to exist in both layers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 19:06:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/694999#M15526</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2011-01-10T19:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695000#M15527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;what i wanted was:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;create graphic layer from the feature layer and render it differently than the feature layer..I donot want to loose the feature layer and it will be rendered different than the graphic layer..&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 19:06:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695000#M15527</guid>
      <dc:creator>abukhan</dc:creator>
      <dc:date>2011-01-10T19:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695001#M15528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Desa:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any example of the above scenerio will be appreciated&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 19:11:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695001#M15528</guid>
      <dc:creator>abukhan</dc:creator>
      <dc:date>2011-01-10T19:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695002#M15529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could create two FeatureLayers where you've set your own renderer or symbol on the 2nd one. This will put more load on the network and the server though so you could duplicate the Graphics and put the copy in the GraphicsLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. create a shallow clone that has a reference to the same geometry and attributes:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var newG:Graphic = new Graphic(oldG.geometry, null, oldG.attributes);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphicsLayer.add(newG);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 19:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695002#M15529</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2011-01-10T19:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: creating a graphic layer from another feature layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695003#M15530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dasa:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot.. it was very useful.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Abu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jan 2011 20:19:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/creating-a-graphic-layer-from-another-feature/m-p/695003#M15530</guid>
      <dc:creator>abukhan</dc:creator>
      <dc:date>2011-01-10T20:19:53Z</dc:date>
    </item>
  </channel>
</rss>

