<?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: TOC widget - group layers across multiple services in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-widget-group-layers-across-multiple-services/m-p/360362#M33403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I cannot provide a&amp;nbsp;full solution for your situation, but here's what little I'll offer if you cannot republish your map services to have the desired group structure.&amp;nbsp; Very generally speaking, you'll need to alter both the html (templateString variable at the top) and a lot of the javascript to compensate for this custom introduced&amp;nbsp;group level.&amp;nbsp; The trick will be how to define groups.&amp;nbsp; Probably requires a new parameter at the top of the widget.&lt;/P&gt;&lt;P&gt;It may require something like this&amp;nbsp;(&lt;SPAN style="color: #ff00ff;"&gt;pink&lt;/SPAN&gt; is added code), though beware this could be poorly thought out.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;templateString: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;'&amp;lt;div class="agsjsTOCNode"&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;'&amp;lt;div data-dojo-attach-point="rowNodeGroup" data-dojo-attach-event="onclick:_onClick"&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;'&amp;lt;span data-dojo-attach-point="checkContainerNodeGroup"&amp;gt;&amp;lt;/span&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;'&amp;lt;span data-dojo-attach-point="labelNodeGroup"&amp;gt;&amp;lt;/span&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;'&amp;lt;div data-dojo-attach-point="rowNode" data-dojo-attach-event="onclick:_onClick"&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;&amp;nbsp;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;In postCreate: function(),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;if you include&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;chk&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;placeAt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;checkContainerNodeGroup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
chk&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;startup&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;and &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;chk &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; domConstruct&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;create&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'input'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 type&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'checkbox'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 checked&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;visible
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;checkContainerNodeGroup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;you'll see it creates a top level checkbox above each map service and layer level.&amp;nbsp; This might be a start for understanding how to piece it together.&amp;nbsp; Good luck if you get into the messy weeds!&amp;nbsp; It will surely strengthen your javascript coding.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:48:29 GMT</pubDate>
    <dc:creator>deleted-user-ZTub55yWbsya</dc:creator>
    <dc:date>2021-12-11T16:48:29Z</dc:date>
    <item>
      <title>TOC widget - group layers across multiple services</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-widget-group-layers-across-multiple-services/m-p/360361#M33402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question is about NLiu's TOC widget.&amp;nbsp;If i've understood correctly, the layerInfos for the TOC takes dynamic map services and feature layers. Our app includes services from various cities, with a service for each city's particular data category (e.g. City1_Water, City1_Electric, City1_Gas, City2_Water, City2_Electric, City2_Gas). I've integrated each as a dynamic map service.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I currently added them to the TOC with success in this way. However, I'm looking to group things one level further, by City. Is there any way to do this out of the box? If not, any suggestions on tweaking the widget to do so?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;toc = new TOC({
 map: window.myMap,
 layerInfos: [
&amp;nbsp;{
 layer: &lt;SPAN&gt;City1_Water&lt;/SPAN&gt;,
 title: "&lt;SPAN&gt;City1_Water&lt;/SPAN&gt;",
 collapsed: true
 },
 {
 layer: &lt;SPAN&gt;City1_Electric&lt;/SPAN&gt;,
 title: "&lt;SPAN&gt;City1_Electric&lt;/SPAN&gt;",
 collapsed: true
 },
 {
 layer: &lt;SPAN&gt;City1_Gas&lt;/SPAN&gt;,
 title: "&lt;SPAN&gt;City1_Gas&lt;/SPAN&gt;",
 collapsed: true
 },
 {
 layer: &lt;SPAN&gt;City2_Water&lt;/SPAN&gt;,
 title: "&lt;SPAN&gt;City2_Water&lt;/SPAN&gt;",
 collapsed: true
 },
 {
 layer: &lt;SPAN&gt;City2_Electric&lt;/SPAN&gt;,
 title: "&lt;SPAN&gt;City2_Electric&lt;/SPAN&gt;",
 collapsed: true
 },
 {
 layer: &lt;SPAN&gt;City2_Gas&lt;/SPAN&gt;,
 title: "&lt;SPAN&gt;City2_Gas&lt;/SPAN&gt;",
 collapsed: true
 }
 ]
 }, 'legendDiv');&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:22:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-widget-group-layers-across-multiple-services/m-p/360361#M33402</guid>
      <dc:creator>NhuMai</dc:creator>
      <dc:date>2021-12-12T16:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: TOC widget - group layers across multiple services</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-widget-group-layers-across-multiple-services/m-p/360362#M33403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I cannot provide a&amp;nbsp;full solution for your situation, but here's what little I'll offer if you cannot republish your map services to have the desired group structure.&amp;nbsp; Very generally speaking, you'll need to alter both the html (templateString variable at the top) and a lot of the javascript to compensate for this custom introduced&amp;nbsp;group level.&amp;nbsp; The trick will be how to define groups.&amp;nbsp; Probably requires a new parameter at the top of the widget.&lt;/P&gt;&lt;P&gt;It may require something like this&amp;nbsp;(&lt;SPAN style="color: #ff00ff;"&gt;pink&lt;/SPAN&gt; is added code), though beware this could be poorly thought out.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;templateString: &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;'&amp;lt;div class="agsjsTOCNode"&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;'&amp;lt;div data-dojo-attach-point="rowNodeGroup" data-dojo-attach-event="onclick:_onClick"&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;'&amp;lt;span data-dojo-attach-point="checkContainerNodeGroup"&amp;gt;&amp;lt;/span&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #ff00ff;"&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;'&amp;lt;span data-dojo-attach-point="labelNodeGroup"&amp;gt;&amp;lt;/span&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-family: Consolas; font-size: small;"&gt;'&amp;lt;div data-dojo-attach-point="rowNode" data-dojo-attach-event="onclick:_onClick"&amp;gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt; +&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;&amp;nbsp;.....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;In postCreate: function(),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;if you include&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;chk&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;placeAt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;checkContainerNodeGroup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
chk&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;startup&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;and &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;chk &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; domConstruct&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;create&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'input'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 type&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'checkbox'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
 checked&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;data&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;visible
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;checkContainerNodeGroup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas; font-size: small;"&gt;you'll see it creates a top level checkbox above each map service and layer level.&amp;nbsp; This might be a start for understanding how to piece it together.&amp;nbsp; Good luck if you get into the messy weeds!&amp;nbsp; It will surely strengthen your javascript coding.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:48:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-widget-group-layers-across-multiple-services/m-p/360362#M33403</guid>
      <dc:creator>deleted-user-ZTub55yWbsya</dc:creator>
      <dc:date>2021-12-11T16:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: TOC widget - group layers across multiple services</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-widget-group-layers-across-multiple-services/m-p/360363#M33404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your response. I'm just now diving into this adventure. I'm leaving the question open&amp;nbsp;in case others have tried this as well..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jan 2017 00:08:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/toc-widget-group-layers-across-multiple-services/m-p/360363#M33404</guid>
      <dc:creator>NhuMai</dc:creator>
      <dc:date>2017-01-26T00:08:48Z</dc:date>
    </item>
  </channel>
</rss>

