<?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 How do I show/hide FeatureLayers programmatically? in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-do-i-show-hide-featurelayers-programmatically/m-p/690988#M18274</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building a extension of the PrintWidget which will print a specific basemap+featureLayer+other settings. For example, it will have a button which when clicked will print the current map, including whatever the user uploaded with the AddData widget, but using the basemap "streets" and a specific FeatureLayer or two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/245743-how-do-i-change-the-basemap-programmatically"&gt;this thread&lt;/A&gt;&amp;nbsp;I learned how to programmatically change the basemap. Now I want to add layers to this new basemap (before printing). But, I cannot find a way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked at&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/159817"&gt;other threads&lt;/A&gt;&amp;nbsp;for possible examples, but they did not work. Namely, this code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp;var featureLayer = new FeatureLayer(url);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp;this.map.addLayer(featureLayer);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;does not actually show the new layer. The code does add the new layer to the LayerList widget (which I did not want), and it is even checked, but data from the layer does not show up on the map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;What I would like is a way to programmatically "click" (show/hide) on a layer in the LayerList widget, from a different widget. Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Jan 2020 20:44:07 GMT</pubDate>
    <dc:creator>JoseVidal</dc:creator>
    <dc:date>2020-01-13T20:44:07Z</dc:date>
    <item>
      <title>How do I show/hide FeatureLayers programmatically?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-do-i-show-hide-featurelayers-programmatically/m-p/690988#M18274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building a extension of the PrintWidget which will print a specific basemap+featureLayer+other settings. For example, it will have a button which when clicked will print the current map, including whatever the user uploaded with the AddData widget, but using the basemap "streets" and a specific FeatureLayer or two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/245743-how-do-i-change-the-basemap-programmatically"&gt;this thread&lt;/A&gt;&amp;nbsp;I learned how to programmatically change the basemap. Now I want to add layers to this new basemap (before printing). But, I cannot find a way to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked at&amp;nbsp;&lt;A _jive_internal="true" href="https://community.esri.com/thread/159817"&gt;other threads&lt;/A&gt;&amp;nbsp;for possible examples, but they did not work. Namely, this code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp;var featureLayer = new FeatureLayer(url);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;&amp;nbsp;this.map.addLayer(featureLayer);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;does not actually show the new layer. The code does add the new layer to the LayerList widget (which I did not want), and it is even checked, but data from the layer does not show up on the map.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;What I would like is a way to programmatically "click" (show/hide) on a layer in the LayerList widget, from a different widget. Any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jan 2020 20:44:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-do-i-show-hide-featurelayers-programmatically/m-p/690988#M18274</guid>
      <dc:creator>JoseVidal</dc:creator>
      <dc:date>2020-01-13T20:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I show/hide FeatureLayers programmatically?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-do-i-show-hide-featurelayers-programmatically/m-p/690989#M18275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;To learn how to toggle a particular layer on or off in WAB, you can take a look at the code in the &lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-8592-layer-toggle-button-widget-version-214-01132020"&gt;Layer Toggle Button widget&lt;/A&gt; for example code. The main thing is the use of the &lt;A href="https://developers.arcgis.com/web-appbuilder/api-reference/layerstructure.htm"&gt;LayerStructure class&lt;/A&gt;&amp;nbsp;and its traversal method to get the layerNode that has a show and hide method.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jan 2020 13:23:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-do-i-show-hide-featurelayers-programmatically/m-p/690989#M18275</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-01-15T13:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I show/hide FeatureLayers programmatically?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-do-i-show-hide-featurelayers-programmatically/m-p/690990#M18276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! I'll take a look.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2020 16:08:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-do-i-show-hide-featurelayers-programmatically/m-p/690990#M18276</guid>
      <dc:creator>JoseVidal</dc:creator>
      <dc:date>2020-01-16T16:08:43Z</dc:date>
    </item>
  </channel>
</rss>

