<?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 What is the syntax for layer-add-result in the map object? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748418#M69241</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A lot of the events for the map don't have any input parameters, but it looks like layer-add-result does.&amp;nbsp; In the documentation, it says that the layer-add-result fires when you add the specified layer.&amp;nbsp; But what is the syntax for this?&amp;nbsp; I want to be able to see specifically when a particular layer is added, not just the plural version, layers-add-result.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Apr 2014 15:13:59 GMT</pubDate>
    <dc:creator>TracySchloss</dc:creator>
    <dc:date>2014-04-17T15:13:59Z</dc:date>
    <item>
      <title>What is the syntax for layer-add-result in the map object?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748418#M69241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A lot of the events for the map don't have any input parameters, but it looks like layer-add-result does.&amp;nbsp; In the documentation, it says that the layer-add-result fires when you add the specified layer.&amp;nbsp; But what is the syntax for this?&amp;nbsp; I want to be able to see specifically when a particular layer is added, not just the plural version, layers-add-result.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 15:13:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748418#M69241</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-04-17T15:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: What is the syntax for layer-add-result in the map object?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748419#M69242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The 'layer-add-result' event actually returns the layer that was added to the map in the callback.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You would have to check in the callback which layer was added and then do something based on that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://jsfiddle.net/tE4A3/7/" rel="nofollow" target="_blank"&gt;http://jsfiddle.net/tE4A3/7/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(map, "layer-add-result", function(layerAdded, errorMsg){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(layerAdded.layer === myLayer){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('found the layer i want, do something specific');&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 15:24:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748419#M69242</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2014-04-17T15:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: What is the syntax for layer-add-result in the map object?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748420#M69243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That makes sense, thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 15:30:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748420#M69243</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2014-04-17T15:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: What is the syntax for layer-add-result in the map object?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748421#M69244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The 'layer-add-result' event actually returns the layer that was added to the map in the callback.&lt;BR /&gt;&lt;BR /&gt;You would have to check in the callback which layer was added and then do something based on that.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://jsfiddle.net/tE4A3/7/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://jsfiddle.net/tE4A3/7/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; on(map, "layer-add-result", function(layerAdded, errorMsg){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(layerAdded.layer === myLayer){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log('found the layer i want, do something specific');&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Just what I needed!&amp;nbsp; Thanks for that.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/what-is-the-syntax-for-layer-add-result-in-the-map/m-p/748421#M69244</guid>
      <dc:creator>AndrewRowe</dc:creator>
      <dc:date>2021-12-12T07:49:03Z</dc:date>
    </item>
  </channel>
</rss>

