<?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 onLayersAddResult not firing in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739334#M68434</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have connected an onLayersAddResult event to my map using dojo connect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see an example at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://jsfiddle.net/xfJL6/" rel="nofollow" target="_blank"&gt;http://jsfiddle.net/xfJL6/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even though I'm adding 3 layers, the event never fires. Is it because I'm using ArcGISDynamicMapServiceLayer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anyway to enumerate the info from the last layer I load? I'd like to use it to create a TOC and a Legend.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2012 23:10:46 GMT</pubDate>
    <dc:creator>JimWharton</dc:creator>
    <dc:date>2012-08-15T23:10:46Z</dc:date>
    <item>
      <title>onLayersAddResult not firing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739334#M68434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have connected an onLayersAddResult event to my map using dojo connect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see an example at &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://jsfiddle.net/xfJL6/" rel="nofollow" target="_blank"&gt;http://jsfiddle.net/xfJL6/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even though I'm adding 3 layers, the event never fires. Is it because I'm using ArcGISDynamicMapServiceLayer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anyway to enumerate the info from the last layer I load? I'd like to use it to create a TOC and a Legend.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2012 23:10:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739334#M68434</guid>
      <dc:creator>JimWharton</dc:creator>
      <dc:date>2012-08-15T23:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: onLayersAddResult not firing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739335#M68435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You have to use the method &lt;/SPAN&gt;&lt;A href="https://community.esri.com/"&gt;&lt;/A&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm#addLayers" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm#addLayers&lt;/A&gt;&lt;SPAN&gt;'&amp;gt;addLayers() in order to take advantage of the event "onLayersAddResult". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can do this by supplying them in an array instead of one at a time&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;map.addLayers([baseLayer, parcelLayer, serviceLayer]);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, make sure to check out our &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/legend.htm" rel="nofollow" target="_blank"&gt;legend widget&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 00:02:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739335#M68435</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2012-08-16T00:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: onLayersAddResult not firing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739336#M68436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brilliant! That makes no sense why addLayer() wouldn't fire the same callback... but I haven't written my own framework so I can't judge.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll check out your legend, thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Jim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 00:10:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739336#M68436</guid>
      <dc:creator>JimWharton</dc:creator>
      <dc:date>2012-08-16T00:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: onLayersAddResult not firing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739337#M68437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have to disagree with you there.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;onLayerAddResult is fired when you load a single layer (using map.addLayer()).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;onLayersAddResult is fired once when you load multiple layers simultaneously, while onLayerAddResult is also fired for each individual layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this gives you the best of both worlds &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check out the doc for more info.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Class:Map&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/map.htm&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 16:13:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739337#M68437</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2012-08-16T16:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: onLayersAddResult not firing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739338#M68438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did not realize there was an event handler called onLayerAddResult. In skimming many of the examples, I don't think I saw it. Or I did see it, and skimmed right over it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you again for clueing me in.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 16:27:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/onlayersaddresult-not-firing/m-p/739338#M68438</guid>
      <dc:creator>JimWharton</dc:creator>
      <dc:date>2012-08-16T16:27:02Z</dc:date>
    </item>
  </channel>
</rss>

