<?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: Layer control (TOC): Hide or Show layers and/or group layers in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435080#M40068</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;very helpful thanks for posting&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://ltergis.iab.uaf.edu/nsn.html"&gt;http://ltergis.iab.uaf.edu/nsn.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2012 21:51:50 GMT</pubDate>
    <dc:creator>jamiehollingsworth</dc:creator>
    <dc:date>2012-05-18T21:51:50Z</dc:date>
    <item>
      <title>Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435064#M40052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know how to handle my layer control with the right JS API statements to the REST API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got a very simple mapservice (called grouped) with a group layer and two sublayers:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;World (0) (Grouplayer)
`-&amp;gt; World Country (1) (Layer)
`-&amp;gt; World Timezone (2) (Layer)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The JS-API Samples with the layer control makes use of the&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;ArcGISDynamicMapServiceLayer.setVisibleLayers()&lt;/STRONG&gt;&lt;SPAN&gt; method to define the visible layers. The parameters for that method are the IDs of the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That doesn't work for group-layers, like this layer "World" with the ID 0. If I write this command in the JS API:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;layer.setVisibleLayers([0]);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I see all layers, even the unchecked layers 1 and 2. What happens, is that the REST interface gets an ExportMap request like this, when I only check the group layer 0 to active:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;http://machine/ArcGIS/rest/services/grouped/MapServer/export?layers=show:0&amp;amp;...&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result is that all layers are shown: World Country and World Timezone, although they are not in the list of the visible layers!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The logic of checking and unchecking grouplayers works, if I use the HIDE method in the REST API. Hiding layer 0 (the grouplayer) returns an empty map. All combinations work with the HIDE option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Question: How can I use the HIDE logic with the JS API? Where is the ArcGISDynamicMapServiceLayer.setHiddenLayers() method? &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; How can I make a layerlist control with grouplayers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can I set the esri.layers.ImageParameters() at runtime after initialization? The ImageParameters have the layerOptions LAYER_OPTION_HIDE. But they are read out and used at initialization.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I achive the logic with the grouplayers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 13:40:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435064#M40052</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2010-09-02T13:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435065#M40053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;edit: my reply was not a solution. Topic still open.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Sep 2010 06:32:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435065#M40053</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2010-09-03T06:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435066#M40054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The solution is: Ignore the group-layers in the updateLayerVisibility() method. Put only the array of the layers (the ones with data) in it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The whole design of a TOC needs to reflect that. I've used now the "Dijit Tree with Multi State Checkboxes" from &lt;/SPAN&gt;&lt;A href="http://www.thejekels.com/" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.thejekels.com/&lt;/A&gt;&lt;SPAN&gt;. The Multi State Checkboxes are important because it brings this updateLayerVisibility() logic up to the interface. Something similar is done by Mansour Raad at &lt;/SPAN&gt;&lt;A href="http://thunderheadxpler.blogspot.com/2010/07/merging-table-of-content-and-legend.html" rel="nofollow noopener noreferrer" target="_blank"&gt;http://thunderheadxpler.blogspot.com/2010/07/merging-table-of-content-and-legend.html&lt;/A&gt;&lt;SPAN&gt; but with additional legend information pictures. He also uses Multi-state Checkboxes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if you use the Multi State Checkboxes, the whole group-layer logic behaves different than in ArcMap and that's mandatory. The group-layer doesn't have any information about what happens at the sublevel. It show only that something at the sublevel is checked but in fact you don't need the group-layer anymore for the request. If you click it, either all sublevels are checked or none. Otherwise if only some sublevels are checked, the grouplayer gets the "intermediate" state. So the group-layer is only for "design" not for real "functionality". &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To fill my Multi-State Checkbox Tree I have to use an external configuration file, that translates the MapService REST-JSON to a hierachical JSON. With that hierachy it is easy to fill the DOJO-store, define the DOJO-model and to fill the Tree. A sample configuration file looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;grouped.json:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
identifier : 'name',
&amp;nbsp; label : 'name',
&amp;nbsp; items : [
&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; name : 'World',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type : 'grouplayer',
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: 0,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visible: true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; children : [
&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; {name : 'World Country', type : 'layer', id: 1, visible: true},
&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; {name : 'World Timezone', type : 'layer', id: 2, visible: true}
&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; ]
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It contains the layer information from the REST-endpoint of the mapservice (&lt;/SPAN&gt;&lt;A href="http://localhost/ArcGIS/rest/services/grouped/MapServer?f=pjson" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost/ArcGIS/rest/services/grouped/MapServer?f=pjson&lt;/A&gt;&lt;SPAN&gt;) but moves the sublayers in the hierachy of the appropriate grouplayer. I have to put the following attributes to a layer: name, type (grouplayer or layer), id (for the ExportMap request) and visible (initially checked or not). The children list the sublayers, which recursively can be grouplayers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunetaly this configuration file has to be written by hand, right now. But it should be possible to write a translator later. The current REST endpoint of a MapService cannot be used right now, because it lists the layers plain and the hierachy is only placed in the "parentLayerId" and "subLayerIds" attributes of a layer. (Assumed that the IDs of the layers are one after another (they are) it should be possible to parse the REST endpoint dynamically and to build the TOC directly with this plain structure and to get rid of the configuration file. But maybe you have to parse it two times to get the TOC. Remember the compilation of the table-of-contents in LaTeX? You had to do it two times. ;)).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway. Here's the code for the store, model, tree, the fetch (query) after a click on a tree-branch, the fetchCompleted method and the HTML page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Store:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;store = new dojo.data.ItemFileWriteStore({
 url: "./datastore/grouped.json"
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Model:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;model = new tmpdir.CheckBoxStoreModel({
 store: store,
 query: {
&amp;nbsp; type: 'grouplayer'
 },
 rootLabel: 'Service',
 checkboxAll: true,
 checkboxRoot: false,
 checkboxState: true,
 checkboxStrict: true,
 checkboxIdent: "visible"
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tree:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;var tree = new tmpdir.CheckBoxTree({
 model: model,
 id: "MenuTree"
},
"CheckboxTree");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Fetch:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;store.fetch({
 query: {
&amp;nbsp; visible: true,
&amp;nbsp; type: "layer"
 },
 queryOptions: {
&amp;nbsp; deep: true
 },
 onBegin: fetchPrepare,
 onComplete: fetchCompleted,
 onError: fetchFailed
});&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FetchCompleted:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function fetchCompleted(items, request) {
 visibleLayers = [];
 var i;
 for (i = 0; i &amp;lt; items.length; i++) {
&amp;nbsp; var item = items&lt;I&gt;;
&amp;nbsp; visibleLayers.push(store.getValue(item, "id"));
 }
 mapServiceLayer.setVisibleLayers(visibleLayers);
}&lt;/I&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;HTML:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;div id="map" style="width: 600px; height: 400px; border: 1px solid #000;"&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;div id="CheckboxTree"&amp;gt;
&amp;lt;/div&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps for similar questions. Discussion and additional information is welcome!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:29:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435066#M40054</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2021-12-11T19:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435067#M40055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Axel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to get group layers to work in a TOC and have tried to implement your suggestions.&amp;nbsp; I'm fairly new to dojo, but did manage to get the multistate checkboxes example to work from the jeckels and can create my layer list successfully.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I can't seem to wrap my head around is how to hook the onCheckboxChange function to the fetchcomplete to update my layer visibility in the map.&amp;nbsp; Nor do I fully understand where to include your store.fetch method? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have a complete working example using the javascript API, could you share?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Susan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Apr 2011 16:03:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435067#M40055</guid>
      <dc:creator>SusanMcclendon</dc:creator>
      <dc:date>2011-04-01T16:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435068#M40056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can see an example here: &lt;/SPAN&gt;&lt;A href="http://mohadiax.de/gis/JS_TreeClient_ArcGIS/"&gt;http://mohadiax.de/gis/JS_TreeClient_ArcGIS/&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See the source-code of the page to know you to do it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Apr 2011 17:19:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435068#M40056</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2011-04-09T17:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435069#M40057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've provided a sample in the Resource Center.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=98d9e760d6d1496487ca583b0e8ce73c"&gt;http://www.arcgis.com/home/item.html?id=98d9e760d6d1496487ca583b0e8ce73c&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Apr 2011 12:07:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435069#M40057</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2011-04-21T12:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435070#M40058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Axxl~!&amp;nbsp; I did finally get it working, but your example helps me greatly.&amp;nbsp; I'm now working on trying to integrate the legend into the functionality of the TOC using the JSON file for the swath.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Susan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2011 19:07:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435070#M40058</guid>
      <dc:creator>SusanMcclendon</dc:creator>
      <dc:date>2011-04-22T19:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435071#M40059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Axel, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your excellent TOC example!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I have one question: How should I deal with the FeatureLayers? If I create a couple featurelayers to select/query against, how would I control their visibility?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently, the featurelayer is always turned on, yet the TOC control doesn't control it as it is separate. Even though that layer is turned off in the TOC, it is still visible because that layer is also a featurelayer. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any advise regarding the handling of the featurelayers? Should I keep the visibility turned off?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I apologize for my ignorance; i'm still fairly new at this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 17:39:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435071#M40059</guid>
      <dc:creator>AndrewBrown1</dc:creator>
      <dc:date>2011-06-14T17:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435072#M40060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;But I have one question: How should I deal with the FeatureLayers? If I create a couple featurelayers to select/query against, how would I control their visibility?&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your comment, Andrew. I guess you have to deal FeatureLayers in a special way. The feature layers don't has to show anything at startup, depending on your selection mode (MODE_ONDEMAND, MODE_SELECTION, MODE_SNAPSHOT). And since it's a 'subclass' of a layer you can 'switch it off' with "myfaeturelayer.hide();"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So in most cases it depends: if you select your features, how you select them (spatial or by attributes). You can show the results of your query in a table and use that for accessing your features. So you don't need it in a TOC as a layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My 2 cents. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 06:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435072#M40060</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2011-06-15T06:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435073#M40061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Axel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your input. You have really helped me thus far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand why we wouldn't have to show the feature layer,&amp;nbsp; but I'm actually selecting features by using a freehand tool, so the layer needs to be turned on in order for the selection to work. I'm currently using MODE_ONDEMAND to perform the select.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, my problem is when I turn off the layer in the TOC, the layer is still turned on the feature layer). How do I control the feature layer in the TOC? Is it possible? I know the layer in the TOC is part of the basemap, as I created it in the grouped.json file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In total, I'll probably have around 6 or so feature layers, so this is an important part of my application. The user needs to have the ability to turn the feature layers on and off, and be able to select the feature layers if they are turned on.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Andrew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2011 17:19:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435073#M40061</guid>
      <dc:creator>AndrewBrown1</dc:creator>
      <dc:date>2011-06-15T17:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435074#M40062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We have implemented the TOC layer control and are currently saving the state of the visible layers to a database.&amp;nbsp; We then retrieve the visible layers if a user presses a load button and update the map based on their saved view.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are using a dynamicmapservice and we pass the array to the setVisibleLayers of the service after the load.&amp;nbsp; This updates the map correctly, however, all of the checkboxes in the TOC remain checked.&amp;nbsp; Is there a preferred way of updating the TOC checkboxes?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 17:13:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435074#M40062</guid>
      <dc:creator>mikesmith5</dc:creator>
      <dc:date>2011-06-16T17:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435075#M40063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We went about this slightly differently, showing layers based on scale dependencies, sort of like the old toclayer function in ArcIMS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.mymanatee.org/gisapps/mapviewer/index.jsp"&gt;Our Site&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is a pretty customized version of the JavaScript sample viewer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2011 17:17:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435075#M40063</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2011-06-16T17:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435076#M40064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Axel,&lt;BR /&gt;&lt;BR /&gt;Thanks again for your input. You have really helped me thus far.&lt;BR /&gt;&lt;BR /&gt;I understand why we wouldn't have to show the feature layer,&amp;nbsp; but I'm actually selecting features by using a freehand tool, so the layer needs to be turned on in order for the selection to work. I'm currently using MODE_ONDEMAND to perform the select.&lt;BR /&gt;&lt;BR /&gt;So, my problem is when I turn off the layer in the TOC, the layer is still turned on the feature layer). How do I control the feature layer in the TOC? Is it possible? I know the layer in the TOC is part of the basemap, as I created it in the grouped.json file.&lt;BR /&gt;&lt;BR /&gt;In total, I'll probably have around 6 or so feature layers, so this is an important part of my application. The user needs to have the ability to turn the feature layers on and off, and be able to select the feature layers if they are turned on.&lt;BR /&gt;&lt;BR /&gt;Thanks again,&lt;BR /&gt;Andrew&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;sorry for the delay. I guess, you have to build the logic yourself. If the layer isn't visible you have to turn off the featurelayer. I haven't worked on an app like this, so far. So I don't know how to deal with feature-layers and how to "switch them off".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess you may implement 2 ways: The hook of the freehand selection has to ask if the layer is visible. Otherwise it won't select. The second logic is in the tree. If the layer-id of your featurelayer isn't visible, you are not able to select it. Depends on the way of your implementation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On the other hand you have not to show the FeatureLayers on the map, if they are visible with the map-service calls. You don't have to show the symbols. You only need the results of your selection on the map (for example the blue/green highlight).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Depending on your workflow and application. Several ways to implement, but you have to implement the communication between the map-service layers and your feature-layers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 12:11:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435076#M40064</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2011-07-11T12:11:04Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435077#M40065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;We have implemented the TOC layer control and are currently saving the state of the visible layers to a database.&amp;nbsp; We then retrieve the visible layers if a user presses a load button and update the map based on their saved view.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;We are using a dynamicmapservice and we pass the array to the setVisibleLayers of the service after the load.&amp;nbsp; This updates the map correctly, however, all of the checkboxes in the TOC remain checked.&amp;nbsp; Is there a preferred way of updating the TOC checkboxes?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know the preferred way of updating the checkboxes from outisde. Currently it works as the main control. Please check the documentation of the Widget: &lt;/SPAN&gt;&lt;A href="http://www.thejekels.com/"&gt;http://www.thejekels.com/&lt;/A&gt;&lt;SPAN&gt; if it's possible. Since it's based on a DOJO tree, that API might also help. I guess there should be a way for doing this, but I haven't done it yet. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 12:20:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435077#M40065</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2011-07-11T12:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435078#M40066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just for information, since the discussion is always coming up and people may end up in this thread.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another nice example of a TOC is here: &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=9c43bdf76a23452ba1d95684f7cd76d8"&gt;http://www.arcgis.com/home/item.html?id=9c43bdf76a23452ba1d95684f7cd76d8&lt;/A&gt;&lt;SPAN&gt; by nliu. It integrates the legend directly under the layer-control, works also with group-layers (although I don't know if you can switch them seperately), has a transparency control, a scale dependecy and other nice things.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 08:56:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435078#M40066</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2011-08-09T08:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435079#M40067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, this is really great! I already incorporated it into our site... now I'm going to try and modify it a little bit to include group layer control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Aug 2011 14:20:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435079#M40067</guid>
      <dc:creator>AndrewBrown1</dc:creator>
      <dc:date>2011-08-09T14:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435080#M40068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;very helpful thanks for posting&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://ltergis.iab.uaf.edu/nsn.html"&gt;http://ltergis.iab.uaf.edu/nsn.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2012 21:51:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435080#M40068</guid>
      <dc:creator>jamiehollingsworth</dc:creator>
      <dc:date>2012-05-18T21:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435081#M40069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How would I be able to keep track which layers have been checked from the TOC?&amp;nbsp; This would be handy to pass this to the identify parameter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 May 2012 21:15:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435081#M40069</guid>
      <dc:creator>Reynaldde_Castro</dc:creator>
      <dc:date>2012-05-24T21:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435082#M40070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;axxl,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I changed the path in the variable worldgroupedUrl to point to my map service, which displays correctly (in addition to changing the map extent of course). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also changed the layers in the 'worldgrouped.json' file (below; mine has no groups though only layers). Does this look correct? I cannot figure out how to change the 'WorldGrouped' title in the TOC (tried changing it in the html file), nor does it display my layer in the TOC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
 identifier: 'name',
 label: 'name',
 items:
 [
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Gates',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 0,
&amp;nbsp;&amp;nbsp; visible: true,
&amp;nbsp;&amp;nbsp; children:
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Fences',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 1,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Railways',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 2,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Primary Roads',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 3,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Roads - Other',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 4,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'SWMUs',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 5,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'SWMU Extents',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 6,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Lakes',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 7,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Buildings/Structures',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 8,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Berms',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 9,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; },
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; name : 'Property Boundary',
&amp;nbsp;&amp;nbsp; type : 'layer',
&amp;nbsp;&amp;nbsp; id: 10,
&amp;nbsp;&amp;nbsp; visible: true
&amp;nbsp; }
 ]
}
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:29:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435082#M40070</guid>
      <dc:creator>BarryGuidry</dc:creator>
      <dc:date>2021-12-11T19:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Layer control (TOC): Hide or Show layers and/or group layers</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435083#M40071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Woo, it's been a long time... Check out also the nice example with legend symbols by nliu at: &lt;/SPAN&gt;&lt;A href="https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109&lt;/A&gt;&lt;SPAN&gt; if you like.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "WorldGrouped" label is part of the model. The rootLabel attribute. Consider my example also as a nice way dealing with stores, models and views.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; worldgroupedModel = new tmpdir.CheckBoxStoreModel({
[...]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rootLabel: 'Your text here...',
[...]
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also your JSON has a children attribute at the "Gates" layer. Delete that line and the comma behind the last attribute.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Axel&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 19:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/layer-control-toc-hide-or-show-layers-and-or-group/m-p/435083#M40071</guid>
      <dc:creator>AxelSchaefer</dc:creator>
      <dc:date>2021-12-11T19:29:56Z</dc:date>
    </item>
  </channel>
</rss>

