<?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 bug when combined with map.addLayers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-bug-when-combined-with-map-addlayers/m-p/178424#M16522</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think i found a bug/memory leak. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an app that can load layers based on a config.&amp;nbsp; The layers can be loaded on the fly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;setA (15 layers, some dynamic, some tiled)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setB (3 layers, some dynamic, some tiled)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setC (10 layers, some dynamic, some tiled)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can start the map with setB, and unload reload (remove all, addLayers[setb]) with no problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do the same with A or B, and switch amongst them, without issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If i add a legend&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can start the map with setB, and unload reload (remove all, addLayers[setb]) with no problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can start the map with setA, and switch to setB, without problem.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I start with any set, and switch to A or C, firefox usage goes up over 1 gb, goes not responding, never comes back (and the "onaddlayersresult event never fires")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if i change to code to &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
if(legend){
legend.destroy();
map.addLayers[setB];
createLegend();}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;it works perfectly, in just a few seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;bug/memory leak? ir bad workflow.&amp;nbsp; Right now i have to code in to replace the legend , but it seems "hacky"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Aug 2013 16:42:56 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2013-08-06T16:42:56Z</dc:date>
    <item>
      <title>legend bug when combined with map.addLayers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-bug-when-combined-with-map-addlayers/m-p/178424#M16522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think i found a bug/memory leak. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have an app that can load layers based on a config.&amp;nbsp; The layers can be loaded on the fly&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;setA (15 layers, some dynamic, some tiled)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setB (3 layers, some dynamic, some tiled)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;setC (10 layers, some dynamic, some tiled)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can start the map with setB, and unload reload (remove all, addLayers[setb]) with no problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can do the same with A or B, and switch amongst them, without issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If i add a legend&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can start the map with setB, and unload reload (remove all, addLayers[setb]) with no problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I can start the map with setA, and switch to setB, without problem.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I start with any set, and switch to A or C, firefox usage goes up over 1 gb, goes not responding, never comes back (and the "onaddlayersresult event never fires")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if i change to code to &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
if(legend){
legend.destroy();
map.addLayers[setB];
createLegend();}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;it works perfectly, in just a few seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;bug/memory leak? ir bad workflow.&amp;nbsp; Right now i have to code in to replace the legend , but it seems "hacky"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Aug 2013 16:42:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/legend-bug-when-combined-with-map-addlayers/m-p/178424#M16522</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2013-08-06T16:42:56Z</dc:date>
    </item>
  </channel>
</rss>

