<?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: Need help with map.GetLayer() in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-help-with-map-getlayer/m-p/66145#M5821</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry-- I forgot to include the URL to our shortlist map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://ccmaps.carlsbadca.gov/shortlistDEV/index.html"&gt;http://ccmaps.carlsbadca.gov/shortlistDEV/index.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 May 2014 14:47:01 GMT</pubDate>
    <dc:creator>JuneAcosta</dc:creator>
    <dc:date>2014-05-08T14:47:01Z</dc:date>
    <item>
      <title>Need help with map.GetLayer()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-help-with-map-getlayer/m-p/66144#M5820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to customize the shortlist template by turning off a specific layer based on the selected tab. I found the code to make the change on the StoryMap forum, but I having some trouble with the code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
function init() {
&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var layers = response.itemInfo.itemData.operationalLayers; 
&amp;nbsp; //for ( var x = 0; x &amp;lt; layers.length; x++){
&amp;nbsp;&amp;nbsp; //alert(layers&lt;X&gt;.id);
&amp;nbsp; //}
 
&amp;nbsp; if(_map.loaded){
&amp;nbsp;&amp;nbsp; initMap(layers);
&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp; dojo.connect(_map,"onLoad",function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp; initMap(layers);
&amp;nbsp;&amp;nbsp; });
&amp;nbsp; }
&amp;nbsp; 
 });
&lt;/X&gt;&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The map gets stuck once it hits trailLayer.setVisibility(false);When using Firefox I can see 'Trail_Lines_7339' being passed, but var trailLayer is undefined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
function initMap(layers) {
 
 trailLayer = _map.getLayer('Trail_Lines_7339');
 //trailLayer = _map.getLayer(_map.layers[1]);
 trailLayer.setVisibility(false);
 //alert(trailLayer);

&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2014 13:43:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-help-with-map-getlayer/m-p/66144#M5820</guid>
      <dc:creator>JuneAcosta</dc:creator>
      <dc:date>2014-05-08T13:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with map.GetLayer()</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-help-with-map-getlayer/m-p/66145#M5821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry-- I forgot to include the URL to our shortlist map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://ccmaps.carlsbadca.gov/shortlistDEV/index.html"&gt;http://ccmaps.carlsbadca.gov/shortlistDEV/index.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 May 2014 14:47:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/need-help-with-map-getlayer/m-p/66145#M5821</guid>
      <dc:creator>JuneAcosta</dc:creator>
      <dc:date>2014-05-08T14:47:01Z</dc:date>
    </item>
  </channel>
</rss>

