<?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: Turn off visibility of line featurelayer in Classic Esri Story Maps Questions</title>
    <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427829#M4923</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Luke, I can tell you how I did it and you can easily modify it for more than one layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Created a variable for the CIP road layer, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var roadLayer;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the section for initializing the map i get a reference to the layer and set its visible property to false since my first tab is not for the road maintenance:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function initMap(layers) {

roadLayer = _map.getLayer('Road_Work_2014_7279');
roadLayer.setVisibility(false);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then to toggle it on or off depending on the tab I do this in the activateLayer function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function activateLayer(layer) {
 preSelection(); 
 _selected = null;
 postSelection();
 _layerCurrent = layer;

if(_layerCurrent.title == 'C.I.P. Projects') {
roadLayer.setVisibility(false);
} else 
{roadLayer.setVisibility(true);
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keith&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 19:15:26 GMT</pubDate>
    <dc:creator>KeithGanzenmuller</dc:creator>
    <dc:date>2021-12-11T19:15:26Z</dc:date>
    <item>
      <title>Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427823#M4917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm putting together a self-hosted shortlist map for our Capital Improvment Program. &lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://70.167.136.51/Salina_CIP%20Tabs2/" rel="nofollow" target="_blank"&gt;Can be found here temporarily&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It has 2 point layers for the tabs and another layer of line features. The line features are from a hosted featureservice created from an uploaded shapefile. In the end I will use the line features so I can reduce the number of point locations in the Road Maintenance tab.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I am trying to do is get a reference to that layer and conditionally turn its visibility off or on. I can loop through the operationalLayers like so to test:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;var layers = response.itemInfo.itemData.operationalLayers;&amp;nbsp; &amp;nbsp; for ( var x = 0; x &amp;lt; layers.length; x++){ &amp;nbsp; alert(layers&lt;X&gt;.id); &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;So the layer I am looking to hide or setVisibility to false shows up as layers[0] (shoes first in the alert statement) but I can't seem to get it to toggle off. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Keith&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 15:29:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427823#M4917</guid>
      <dc:creator>KeithGanzenmuller</dc:creator>
      <dc:date>2014-03-12T15:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427824#M4918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, solved it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem was, I believe, I was trying to get to the layers and setVisibility too soon. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I placed the code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;roadLayer = _map.getLayer('Road_Work_2014_7279'); roadLayer.setVisibility(false);&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in the initMap function and it works now. When I activate a tab it turns on or off the line features as needed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Mar 2014 19:43:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427824#M4918</guid>
      <dc:creator>KeithGanzenmuller</dc:creator>
      <dc:date>2014-03-12T19:43:05Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427825#M4919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Keith&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That's great you got that to work and it is a really nice customization of the Shortlist to make additional features appear when the user switches to a different tab. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A couple of suggestions from me: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- The road centerline features that you turn on via the Road Maintenance tabs are a bit hard to see on the map&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- The road centerline features can be clickable if you want so users can get a popup about them and also hover over them to get the street name. To do that though they'd need to have the full set of attributes that the Shortlist template expects (same as the point features in your tabs) and would need to be added into your web map as a zipped up shapefile rather than a feature service). (Feature services currently aren't supported as clickable supporting layers in the Shortlist but can be added as non-clickable features like you have done).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- You've added behavior that auto-zooms when the user clicks on a point of interest either in the tabs or in the map. Nothing wrong with that technically but we would perhaps recommend against doing that in the Shortlist template because, as the tabs are context sensitive to the current extent of the map, it means that the contents of the user's tabs will change dramatically as soon as they click on anything, because they'll only see places listed that are inside their current extent, and they have to click the Home button to get back to the initial state where they can see all of the places&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 17:41:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427825#M4919</guid>
      <dc:creator>RupertEssinger</dc:creator>
      <dc:date>2014-03-13T17:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427826#M4920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Rupert, thank you for the look and the suggestions. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I agree wholeheartedly about the road centerlines. I definitely have to make them more visible. At the time I copied the site over to the public server I wasn't sure if I could get it to work or not so I didn't bother with changing the symbology. I need to to enhance the centerlines and thin out the points now though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the auto-zoom, good point. I am not sure whether to keep that set to automatically zoom or will add that as a choice on the infoWindow (or perhaps neither). The same goes for the aerial photography that appears when you zoom in far enough. So far there is only one project where the aerial is important. I could set it to come on only if the user selects that project also. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Departments (and Commissioners) track the CIP Projects on a spreadsheet and they requested the ability to hyperlink from the line in the spreadsheet that contains the project to the CIP (Shortlist) Page so I have a version of it that accepts url parameters then centers and zooms the map to the project.&amp;nbsp; Still in progress but the roughed in code works. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks KG&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 18:02:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427826#M4920</guid>
      <dc:creator>KeithGanzenmuller</dc:creator>
      <dc:date>2014-03-13T18:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427827#M4921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We generally avoid auto-zoom in the story maps so that the user can control the map extent themselves. It can be frustrating for users we feel if they zoom to an extent and scale they are comfortable with only for the app to suddenly override their choice. We do pan the map automatically if the point the user has indicated they are interested in is not currently visible on the map, although that situation never happens in the Shortlist because the tabs don't display places that aren't in the current extent. The map tour has an auto-zoom option that lets the author choose to zoom the user to a specific scale once they start to proceed through the tour, which is nice because authors can start off showing an overview of all the points and then have the map zoom in as the user starts the tour. But even in that case we've built in a rule that if the user does choose to manually zoom the map as they proceed through the tour, the auto-zoom automatically turns itself off to put the end-user in charge of the zoom level.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2014 18:19:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427827#M4921</guid>
      <dc:creator>RupertEssinger</dc:creator>
      <dc:date>2014-03-13T18:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427828#M4922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahh - looking to do the exact same thing here.&amp;nbsp; One of my tabs is "water CIP" and the other is "sewer CIP".&amp;nbsp; I'd like to have linework for the sewer CIP projects appear with the sewer tab, and water linework appear with the water tab.&amp;nbsp; No idea where to start...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 19:08:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427828#M4922</guid>
      <dc:creator>LukeFawcett</dc:creator>
      <dc:date>2014-03-17T19:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427829#M4923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Luke, I can tell you how I did it and you can easily modify it for more than one layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Created a variable for the CIP road layer, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var roadLayer;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the section for initializing the map i get a reference to the layer and set its visible property to false since my first tab is not for the road maintenance:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function initMap(layers) {

roadLayer = _map.getLayer('Road_Work_2014_7279');
roadLayer.setVisibility(false);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then to toggle it on or off depending on the tab I do this in the activateLayer function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function activateLayer(layer) {
 preSelection(); 
 _selected = null;
 postSelection();
 _layerCurrent = layer;

if(_layerCurrent.title == 'C.I.P. Projects') {
roadLayer.setVisibility(false);
} else 
{roadLayer.setVisibility(true);
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Keith&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:15:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427829#M4923</guid>
      <dc:creator>KeithGanzenmuller</dc:creator>
      <dc:date>2021-12-11T19:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427830#M4924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Keith - thanks much for your reply!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see that your "Road_Work_2014_7279" is a FeatureServer layer from an SDE.&amp;nbsp; Would that make a difference with this functionality?&amp;nbsp; My line layer is pulling from a MapServer service.&amp;nbsp; This is really the only difference I see so far.&amp;nbsp; (Still trying to get the app to load with your added code.&amp;nbsp; I may send you what I have if you are willing to give it a glance.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 19:59:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427830#M4924</guid>
      <dc:creator>LukeFawcett</dc:creator>
      <dc:date>2014-03-18T19:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427831#M4925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My road work layer was just a zipped up shapefile uploaded to ArcGIS Online, not directly to the Web Map but added as an item in My Contents. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I had a hard time getting a reference to it so I had the code loop through the layers to see what name was being used for each layer and discovered that what I called Road_Work_2014 was being called as Road_Work_2014_7279. I don't know where the _7279 came from but it may be a way for ArcGIS Online to uniquely identify its hosted feature services. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to turn on and off the visibility of any of the layers once you get a reference to them. If you add the layer in code you can use whatever name you gave it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm far from an expert level programmer but I'll certainly have a look at anything for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 20:15:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427831#M4925</guid>
      <dc:creator>KeithGanzenmuller</dc:creator>
      <dc:date>2014-03-18T20:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427832#M4926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Keith, finding the right reference to my polyline layer did the trick.&amp;nbsp; Once I added the unique ID, it worked great!&amp;nbsp; I also was able to restrict the visibility of several line layers depending on what tab was activated.&amp;nbsp; Very nice, thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 17:47:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427832#M4926</guid>
      <dc:creator>LukeFawcett</dc:creator>
      <dc:date>2014-03-20T17:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427833#M4927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Excellent, glad I could help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Mar 2014 17:51:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427833#M4927</guid>
      <dc:creator>KeithGanzenmuller</dc:creator>
      <dc:date>2014-03-20T17:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427834#M4928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Im trying to get this to work in my shortlist template. It seems like my variable to the reference layer is not getting set. The loading symbol just keeps spinning when it hits trailLayer.setVisibility(false) in the activateLayer function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does it matter where in the initMap(Layer) I set the variable to reference the layer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-June&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 22:01:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427834#M4928</guid>
      <dc:creator>JuneAcosta</dc:creator>
      <dc:date>2014-04-28T22:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427835#M4929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Well, I'm sure the answer to that is "it depends" on what else you are doing in the initMap function. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For me, I set them the very first thing. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As stated previously up above, my biggest headache was getting the actual name of the layer, not the one that appears in the table of contents. For example, I have a layer named ADA_Ramps but I can't reference it by that name because AGS online refers to it as ADA_Ramps_5740. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Initially I looped through all the map layers and displayed the name. Then I did a&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&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;&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; adaLayer = _map.getLayer('ADA_Ramps_5740');
&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;&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; adaLayer.setVisibility(false);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:15:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427835#M4929</guid>
      <dc:creator>KeithGanzenmuller</dc:creator>
      <dc:date>2021-12-11T19:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427836#M4930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I did loop through the map layers and got the AGOL name, 'Trail_Lines_7339'.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;trailLayer.setVisibility(false) locks up the app, and alert(trailLayer) returns undefined.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's my initMap()- are you using the same shortlist template?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function initMap(layers) {
 
 trailLayer = _map.getLayer('Trail_Lines_7339');
 //trailLayer.setVisibility(false);
 alert(trailLayer);
 
 var supportLayers = [];
 var pointLayers = [];
 
 var arrExemptions = [];
 $.each(POINT_LAYERS_NOT_TO_BE_SHOWN_AS_TABS.split("|"), function(index, value) {
&amp;nbsp; arrExemptions.push($.trim(value).toLowerCase());
 });
 
 var supportingLayersThatAreClickable = [];
 $.each(SUPPORTING_LAYERS_THAT_ARE_CLICKABLE.split("|"), function(index, value) {
&amp;nbsp; //alert(SUPPORTING_LAYERS_THAT_ARE_CLICKABLE);
&amp;nbsp; supportingLayersThatAreClickable.push($.trim(value).toLowerCase());
 });
 
 //trailLayer = _map.getLayer(SUPPORTING_LAYERS_THAT_ARE_CLICKABLE);
 //trailLayer.setVisibility(false);
 //alert(trailLayer);
&amp;nbsp; 
 $.each(layers, function(index,value){
&amp;nbsp; if (value.url == null || value.type == "CSV") {
&amp;nbsp;&amp;nbsp; if (
&amp;nbsp;&amp;nbsp;&amp;nbsp; getFeatureSet(value).geometryType == "esriGeometryPoint" &amp;amp;&amp;amp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; $.inArray(value.title.toLowerCase(), arrExemptions) == -1
&amp;nbsp;&amp;nbsp;&amp;nbsp; ) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; pointLayers.push(value);
&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp; supportLayers.push(value);
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp; // if the layer has an url property (meaning that it comes from a service), just
&amp;nbsp;&amp;nbsp; // keep going...it will remain in the map, but won't be query-able.
&amp;nbsp; }&amp;nbsp; 
 });

 //_trailLayer = _map.getLayer('Trail_Lines_7339');
 //_trailLayer.setVisibility(false);
 //alert(_trailLayer);
 _initExtent = _map.extent;
 
 var supportLayer;
 $.each(supportLayers,function(index,value) {
&amp;nbsp; supportLayer = _map.getLayer($.grep(_map.graphicsLayerIds, function(n,i){return _map.getLayer(n).id == getID(value)})[0]);
&amp;nbsp; /////alert(supportLayer);
&amp;nbsp; if (supportLayer == null) return;
&amp;nbsp; $.each(supportLayer.graphics,function(index,value) {
&amp;nbsp;&amp;nbsp; value.attributes.getValueCI = getValueCI; // assign extra method to handle case sensitivity
&amp;nbsp; });
&amp;nbsp; if ($.inArray(value.title.toLowerCase(), supportingLayersThatAreClickable) &amp;gt; -1) {
&amp;nbsp;&amp;nbsp; dojo.connect(supportLayer, "onMouseOver", baselayer_onMouseOver);
&amp;nbsp;&amp;nbsp; dojo.connect(supportLayer, "onMouseOut", baselayer_onMouseOut);
&amp;nbsp;&amp;nbsp; dojo.connect(supportLayer, "onClick", baselayer_onClick);
&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp; dojo.connect(supportLayer, "onClick", function(){unselect()});
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; 
 });
 
 var contentLayer;
 var colorScheme;
 var colorOrder = COLOR_ORDER.split(",");
 var colorIndex;
 $.each(pointLayers,function(index,value) {
&amp;nbsp; _map.removeLayer(_map.getLayer($.grep(_map.graphicsLayerIds, function(n,i){return _map.getLayer(n).id == getID(value)})[0]));
&amp;nbsp; $.each(getFeatureSet(value).features, function(index,value) {
&amp;nbsp;&amp;nbsp; value.attributes.getValueCI = getValueCI; // assign extra method to handle case sensitivity
&amp;nbsp;&amp;nbsp; value.attributes[FIELDNAME_ID] = index; // assign internal shortlist id
&amp;nbsp; });
&amp;nbsp; /* color index assignment is a weird bit of voodoo.&amp;nbsp; first thing to consider
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is that layers names actually appear in tabs in reverse order (i.e. last layer in
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; is leftmost tab).&amp;nbsp; this means that we have to invert the color index for things to match
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; right.&amp;nbsp; also, using modulus to handle overflow -- when there are more layers
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; than colors.&amp;nbsp; so, we end up re-using colors but keeping the sequence. */
&amp;nbsp; colorIndex = (pointLayers.length - index - 1) % colorOrder.length;
&amp;nbsp; colorScheme = $.grep(COLOR_SCHEMES, function(n,i){
&amp;nbsp;&amp;nbsp; return n.name.toLowerCase() == $.trim(colorOrder[colorIndex].toLowerCase())
&amp;nbsp; })[0];
&amp;nbsp; contentLayer = buildLayer(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getFeatureSet(value).features.sort(SortByNumber),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colorScheme.iconDir,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; colorScheme.iconPrefix
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );
&amp;nbsp; contentLayer.color = colorScheme.color;
&amp;nbsp; contentLayer.title = value.title;
&amp;nbsp; dojo.connect(contentLayer, "onMouseOver", layer_onMouseOver);
&amp;nbsp; dojo.connect(contentLayer, "onMouseOut", layer_onMouseOut);
&amp;nbsp; dojo.connect(contentLayer, "onClick", layer_onClick);
 
&amp;nbsp; //alert(contentLayer.title); only the tab layers for this function
&amp;nbsp; _map.addLayer(contentLayer);
&amp;nbsp; _contentLayers.push(contentLayer);
 });

 _contentLayers.reverse();
 $.each(_contentLayers,function(index,value){
&amp;nbsp; $("#tabs").append('&amp;lt;div class="tab" onclick="activateLayer(_contentLayers['+index+'])"&amp;gt;'+value.title+'&amp;lt;/div&amp;gt;');
 });
 
 if ($(".tab").length == 1) $(".tab").css("display", "none");

 activateLayer(_contentLayers[0]);
 dojo.connect(_map.infoWindow,"onHide",infoWindow_onHide);
 $("#zoomToggle").css("visibility","visible");
 $("#whiteOut").fadeOut("slow");&amp;nbsp; 


 //trailLayer = _map.getLayer('Trail_Lines_7339');
 //trailLayer.setVisibility(false);
 //alert(trailLayer);

}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:15:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427836#M4930</guid>
      <dc:creator>JuneAcosta</dc:creator>
      <dc:date>2021-12-11T19:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Turn off visibility of line featurelayer</title>
      <link>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427837#M4931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;One quick tip that is indirectly related to this. In the current version of the Shortlist released three weeks ago, we made a couple of changes that make it easier to work with supporting layers (i.e. layers containing features that you add into a Shortlist that are in addition to the numbered point features that are represented in the tabs):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) You can now add supporting layers into a Shortlist. Previously it wasn't possible to add a point layer into a Shortlist without it being treated as defining one of the tabs. There's a new POINT_LAYERS_NOT_TO_BE_SHOWN_AS_TABS variable in the index.html that lets you specify these layers. For example this new option lets you add features like trolley stations, bus stops or wells into your Shortlist that users can click on to get more information without them appearing as numbered points and defining a tab.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2) By default, supporting layers you add into a Shortlist from shapefiles (point, line or poly) or CSV files (points) are not clickable by the user. Previously these layers were always clickable and this wasn't great because you were perhaps just trying to add some some features into your map not intending them to be clickable, and users would get odd looking results if they clicked on the features if they didn't have all the Shortlist attributes. So shapefile and CSV file based layers are not clickable unless the author specifically opts in by specifying the names of the supporting layer(s) they want to be clickable in the new SUPPORTING_LAYERS_THAT_ARE_CLICKABLE variable in the Index.html. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see both of these variables at work in the example below via overrides specified as URL parameters (which is easier than editing the index.html file for showing examples because it saves me having to install the Shortlist specially just to show this particular example). In this example, I've added a shapefile layer called Stations into a test Shortlist containing all the trolley stations in San Diego. So via the URL parameters I've told the Shortlist not to use the Stations layer to define a tab and to also treat this layer, and several others in the web map, as clickable layers, so users can click on them to get a popup of information. The Stations layer is one I downloaded from the SANGIS website as a shapefile, and then all I had to do was add the attributes that the Shortlist expects, like the link to an image, to populate the popups:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://storymaps.esri.com/templates/shortlist/?webmap=609cc1431cf94b9eb5a72427af6d3409&amp;amp;POINT_LAYERS_NOT_TO_BE_SHOWN_AS_TABS=Stations&amp;amp;SUPPORTING_LAYERS_THAT_ARE_CLICKABLE=Neighborhoods|Ferries|Beaches|Parks|Stations"&gt;http://storymaps.esri.com/templates/shortlist/?webmap=609cc1431cf94b9eb5a72427af6d3409&amp;amp;POINT_LAYERS_NOT_TO_BE_SHOWN_AS_TABS=Stations&amp;amp;SUPPORTING_LAYERS_THAT_ARE_CLICKABLE=Neighborhoods|Ferries|Beaches|Parks|Stations&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(The trolley lines were also downloaded from SANGIS and are actually a feature service in this map. I didn't want the trolley lines to be clickable in this Shortlist).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that this Shortlist also doesn't make use of the Details panel. This is another new feature. By default now, the Shortlist popups don't have a Details panel. This is a nice default because it means that authors who don't want to provide all of the Shortlist attributes that are used to populate the Details panel don't have to. (Not all Shortlist authors write as much as I do about places!). We noticed that a lot of Shortlists folks were making didn't have much info in the Details panel. So now you can make a Shortlist with just a few attributes for each place. If you do want to use the Details panel, you can simply opt in using the new DETAILS_PANEL variable in the Index.html file. Make that true instead of false and you'll have a Details panel. The link below launches the same Shortlist as the link above except that I enabled the Details panel by putting DETAILS_PANEL=true in the URL as an override:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://storymaps.esri.com/templates/shortlist/?webmap=609cc1431cf94b9eb5a72427af6d3409&amp;amp;DETAILS_PANEL=true&amp;amp;POINT_LAYERS_NOT_TO_BE_SHOWN_AS_TABS=Stations&amp;amp;SUPPORTING_LAYERS_THAT_ARE_CLICKABLE=Neighborhoods|Ferries|Beaches|Parks|Stations"&gt;http://storymaps.esri.com/templates/shortlist/?webmap=609cc1431cf94b9eb5a72427af6d3409&amp;amp;DETAILS_PANEL=true&amp;amp;POINT_LAYERS_NOT_TO_BE_SHOWN_AS_TABS=Stations&amp;amp;SUPPORTING_LAYERS_THAT_ARE_CLICKABLE=Neighborhoods|Ferries|Beaches|Parks|Stations&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to take advantage of these new features and don't see those variables in your index.html file, then you should download the Shortlist application again. The Readme.pdf in the download has the full details. I've put a copy of the Readme online here too:&lt;/SPAN&gt;&lt;A href=" http://downloads.esri.com/blogs/places/shortlist/Readme.pdf"&gt; http://downloads.esri.com/blogs/places/shortlist/Readme.pdf&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 23:56:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/classic-esri-story-maps-questions/turn-off-visibility-of-line-featurelayer/m-p/427837#M4931</guid>
      <dc:creator>RupertEssinger</dc:creator>
      <dc:date>2014-05-05T23:56:11Z</dc:date>
    </item>
  </channel>
</rss>

