<?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 Legend adding layer twice in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/legend-adding-layer-twice/m-p/378245#M8891</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having an issue when I call the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;myLegend.layers = [event.layer]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where myLegend is just the basic ESRI legend from the API. For some reason, the layer shows up twice in the legend even though the layer is only in the map once.&amp;nbsp; Has anyone else encountered this or have a resolution?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 May 2011 14:11:39 GMT</pubDate>
    <dc:creator>JoshObrecht</dc:creator>
    <dc:date>2011-05-11T14:11:39Z</dc:date>
    <item>
      <title>Legend adding layer twice</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/legend-adding-layer-twice/m-p/378245#M8891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having an issue when I call the line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;myLegend.layers = [event.layer]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;where myLegend is just the basic ESRI legend from the API. For some reason, the layer shows up twice in the legend even though the layer is only in the map once.&amp;nbsp; Has anyone else encountered this or have a resolution?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2011 14:11:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/legend-adding-layer-twice/m-p/378245#M8891</guid>
      <dc:creator>JoshObrecht</dc:creator>
      <dc:date>2011-05-11T14:11:39Z</dc:date>
    </item>
    <item>
      <title>Re: Legend adding layer twice</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/legend-adding-layer-twice/m-p/378246#M8892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Not sure if it would matter, but can you verify of event.layer.loaded is true before adding it to legend? Not sure what the internals of the ESRI legend look like, but if the layers load event fires after adding it to legend, maybe it's adding it again internally.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2011 14:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/legend-adding-layer-twice/m-p/378246#M8892</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2011-05-11T14:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Legend adding layer twice</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/legend-adding-layer-twice/m-p/378247#M8893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unless I'm not following you correctly, it doesn't appear that is the case.&amp;nbsp; I tried inserting the LayerEvent.LOAD and that seemed to only run once.&amp;nbsp; I am trying to have the legend change when a layer is added.&amp;nbsp; I set an Alert directly before setting the legend and the Alert is only called once and even though the layer is only in the Legend layers array once, it shows twice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 May 2011 17:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/legend-adding-layer-twice/m-p/378247#M8893</guid>
      <dc:creator>JoshObrecht</dc:creator>
      <dc:date>2011-05-13T17:14:57Z</dc:date>
    </item>
  </channel>
</rss>

