<?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: LayerList 4.x hide layer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668342#M62409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If you add a "title" property to your&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;parcelGL layer then it would not show as Untitled layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Mar 2017 21:08:53 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-03-13T21:08:53Z</dc:date>
    <item>
      <title>LayerList 4.x hide layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668341#M62408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I added GraphicLayer to the LayerList Widget sameple and get "Untitled layer." &amp;nbsp;&lt;SPAN&gt;I wonder is there a ways to hide "Untitled layer" or hide MapImageLayer. &amp;nbsp; &amp;nbsp;See code below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;meta charset="utf-8"&amp;gt;&lt;BR /&gt; &amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;LayerList widget - 4.3&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;link rel="stylesheet" href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F4.3%2Fesri%2Fcss%2Fmain.css" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/4.3/esri/css/main.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;style&amp;gt;&lt;BR /&gt; html,&lt;BR /&gt; body,&lt;BR /&gt; #viewDiv {&lt;BR /&gt; padding: 0;&lt;BR /&gt; margin: 0;&lt;BR /&gt; height: 100%;&lt;BR /&gt; width: 100%;&lt;BR /&gt; overflow: hidden;&lt;BR /&gt; }&lt;BR /&gt; &amp;lt;/style&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;lt;script src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F4.3%2F" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/4.3/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt; require([&lt;BR /&gt; "esri/views/SceneView", "esri/layers/GraphicsLayer",&lt;BR /&gt; "esri/widgets/LayerList",&lt;BR /&gt; "esri/WebScene",&lt;/P&gt;&lt;P&gt;"dojo/domReady!"&lt;BR /&gt; ], function(&lt;BR /&gt; SceneView, GraphicsLayer, LayerList, WebScene&lt;BR /&gt; ) {&lt;/P&gt;&lt;P&gt;var scene = new WebScene({&lt;BR /&gt; portalItem: { // autocasts as new PortalItem()&lt;BR /&gt; id: "66adfe99eeaf40fc82ad1e94751cff0b"&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;var view = new SceneView({&lt;BR /&gt; container: "viewDiv",&lt;BR /&gt; map: scene&lt;BR /&gt; });&lt;BR /&gt; &lt;BR /&gt; var parcelGL;&lt;BR /&gt; parcelGL = new GraphicsLayer();&lt;BR /&gt; scene.add(parcelGL);&lt;/P&gt;&lt;P&gt;view.then(function() {&lt;BR /&gt; var layerList = new LayerList({&lt;BR /&gt; view: view&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;// Add widget to the top right corner of the view&lt;BR /&gt; view.ui.add(layerList, "top-right");&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/head&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/339881_pastedImage_5.png" style="width: auto; height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 20:44:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668341#M62408</guid>
      <dc:creator>jamesa</dc:creator>
      <dc:date>2017-03-13T20:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList 4.x hide layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668342#M62409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;If you add a "title" property to your&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;parcelGL layer then it would not show as Untitled layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 21:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668342#M62409</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-13T21:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList 4.x hide layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668343#M62410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You'd have to use the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-LayerList.html#operationalItems"&gt;operationalItems &lt;/A&gt;property to the collection of layers you want to include&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Mar 2017 21:24:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668343#M62410</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2017-03-13T21:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList 4.x hide layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668344#M62411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show me how do you add that to the code? &lt;/P&gt;&lt;P&gt;I really appreciated that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Mar 2017 12:14:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668344#M62411</guid>
      <dc:creator>jamesa</dc:creator>
      <dc:date>2017-03-14T12:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList 4.x hide layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668345#M62412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I find that I have to add some code to prevent graphics layers from being added to&amp;nbsp;&lt;SPAN style="color: #4c4c4c; font-weight: 300;"&gt;operationalItems:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;
layerList&lt;/SPAN&gt;.operationalItems.&lt;SPAN style="color: #7a7a43;"&gt;on&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"before-add"&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;function&lt;/SPAN&gt;(event){
&lt;SPAN style="color: #808080;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;if &lt;/SPAN&gt;(event.&lt;SPAN style="color: #7a7a43;"&gt;item&lt;/SPAN&gt;.&lt;SPAN style="background-color: #e4e4ff;"&gt;layer&lt;/SPAN&gt;.type == &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"graphics"&lt;/SPAN&gt;) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; event.&lt;SPAN style="color: #7a7a43;"&gt;preventDefault&lt;/SPAN&gt;();
&amp;nbsp; }
});

&lt;/PRE&gt;&lt;P&gt;Whenever layerList tries to add a graphics layer to the list, this cancels that operation. &amp;nbsp;A bit of a hack, hopefully ESRI will come up with a better way of dealing with this!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:14:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668345#M62412</guid>
      <dc:creator>JimNoel</dc:creator>
      <dc:date>2021-12-12T04:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList 4.x hide layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668346#M62413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set the listMode on the layer to "hide". See the link below &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/grin.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode" title="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html#listMode"&gt;Layer | API Reference | ArcGIS API for JavaScript 4.3&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 05:20:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668346#M62413</guid>
      <dc:creator>MattDriscoll</dc:creator>
      <dc:date>2017-04-20T05:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList 4.x hide layer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668347#M62414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, that's a much better way.&amp;nbsp; Thank you!&amp;nbsp; I wouldn't have thought of looking under Layer properties rather than LayerList for that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Apr 2017 21:10:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layerlist-4-x-hide-layer/m-p/668347#M62414</guid>
      <dc:creator>JimNoel</dc:creator>
      <dc:date>2017-04-20T21:10:13Z</dc:date>
    </item>
  </channel>
</rss>

