<?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 Eliminate title row in TOC for one layer service in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/eliminate-title-row-in-toc-for-one-layer-service/m-p/306695#M28152</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question is specifically for using&amp;nbsp;map services containing one layer in NLiu's TOC. In the following code (from the widget), I am understanding that there is&amp;nbsp;the possibility of eliminating the first row corresponding to the layer entry's title :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_createRootLayerNode: function(rootLayer){
 domClass.add(this.rowNode, 'agsjsTOCRootLayer');
 domClass.add(this.labelNode, 'agsjsTOCRootLayerLabel');
 var title = this.rootLayerTOC.config.title;
 // if it is '' then it means we do not title to be shown, i.e. not indent.
 if (title === '') {
 // we do not want to show the first level, typically in the case of a single map service
 esri.hide(this.rowNode);
 rootLayer.show();
 this.rootLayerTOC._currentIndent--;
 } else if (title === undefined){
 // no title is set, try to find default
 if (rootLayer.name){
 // this is a featureLayer
 title = rootLayer.name;
 } else {
 var start = rootLayer.url.toLowerCase().indexOf('/rest/services/');
 var end = rootLayer.url.toLowerCase().indexOf('/mapserver', start);
 title = rootLayer.url.substring(start + 15, end);
 }
 }
...
 }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when setting the title: as '', the service just doesn't appear in the TOC. &amp;nbsp;Anyone gotten this work? Am I misunderstanding what this part of the code is supposed to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function initLegend () {
 toc = new TOC({
 map: window.myMap,
 layerInfos: [
 {
 layer: OneLayerService,
 title: '',
 collapsed: true
 //layerList: layerInfo
 }
 ]
 }, 'legendDiv');&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:19:13 GMT</pubDate>
    <dc:creator>NhuMai</dc:creator>
    <dc:date>2021-12-12T16:19:13Z</dc:date>
    <item>
      <title>Eliminate title row in TOC for one layer service</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/eliminate-title-row-in-toc-for-one-layer-service/m-p/306695#M28152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question is specifically for using&amp;nbsp;map services containing one layer in NLiu's TOC. In the following code (from the widget), I am understanding that there is&amp;nbsp;the possibility of eliminating the first row corresponding to the layer entry's title :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;_createRootLayerNode: function(rootLayer){
 domClass.add(this.rowNode, 'agsjsTOCRootLayer');
 domClass.add(this.labelNode, 'agsjsTOCRootLayerLabel');
 var title = this.rootLayerTOC.config.title;
 // if it is '' then it means we do not title to be shown, i.e. not indent.
 if (title === '') {
 // we do not want to show the first level, typically in the case of a single map service
 esri.hide(this.rowNode);
 rootLayer.show();
 this.rootLayerTOC._currentIndent--;
 } else if (title === undefined){
 // no title is set, try to find default
 if (rootLayer.name){
 // this is a featureLayer
 title = rootLayer.name;
 } else {
 var start = rootLayer.url.toLowerCase().indexOf('/rest/services/');
 var end = rootLayer.url.toLowerCase().indexOf('/mapserver', start);
 title = rootLayer.url.substring(start + 15, end);
 }
 }
...
 }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, when setting the title: as '', the service just doesn't appear in the TOC. &amp;nbsp;Anyone gotten this work? Am I misunderstanding what this part of the code is supposed to do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function initLegend () {
 toc = new TOC({
 map: window.myMap,
 layerInfos: [
 {
 layer: OneLayerService,
 title: '',
 collapsed: true
 //layerList: layerInfo
 }
 ]
 }, 'legendDiv');&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:19:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/eliminate-title-row-in-toc-for-one-layer-service/m-p/306695#M28152</guid>
      <dc:creator>NhuMai</dc:creator>
      <dc:date>2021-12-12T16:19:13Z</dc:date>
    </item>
  </channel>
</rss>

