<?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 TOC Hide Children in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/layerlist-toc-hide-children/m-p/625772#M13913</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to get my "hideChildren" function working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I managed to hide the children of a MapService (Layer) but I didn't find a way of hiding the children of a particular GroupLayer in the MapService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To hide the Children of the MapService:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;In TOCWidget.mxml:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var lyr:Layer = ViewerContainer.getInstance().mapManager.map.getLayer("myLayer");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;toc.hideChildren(lyr); &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;In TOC.as:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public function hideChildren(layer:Layer):void{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var tocItem:TocMapLayerItem;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(_mapLayerItems[layer]) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tocItem = _mapLayerItems[layer];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tocItem = new TocMapLayerItem(layer,_labelFunction,_isMapServiceOnly);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_mapLayerItems[layer] = tocItem;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (tocItem.children){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tocItem.children = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (_tocRoots)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var i:int = _tocRoots.length - 1; i &amp;gt;= 0; i--)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (TocItem(_tocRoots&lt;I&gt;).parent === tocItem.parent)&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_tocRoots.removeItemAt(i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it keeps the TopLevel of the tree visible and hide the children in the Table Of Content, if the Children are turned on, they are still visible on the map (that's what I want) they are just "hidden" in the TOC tree.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a start but it's not quite what I want to achieve. I'd like to hide the Children of a specific GroupLayer within the MapService and not all the childrens of the MapServices.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 May 2011 02:22:57 GMT</pubDate>
    <dc:creator>SchoppMatthieu</dc:creator>
    <dc:date>2011-05-17T02:22:57Z</dc:date>
    <item>
      <title>LayerList TOC Hide Children</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/layerlist-toc-hide-children/m-p/625771#M13912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Arc Server 10 Flexviewer 2.3.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=e2cb71d5c04d40d19e9f945ae0db7ce8"&gt;Table Of Content&lt;/A&gt;&lt;SPAN&gt; implemented by Robert Scheitlin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my mapservices , I have some "groupLayers" that contain duplicated data with different symbology at different scale, all the items whithin these GroupLayers are turned on. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The users just need to turn the GroupLayer on or off to see the data and it's not relevant for them to be able to dropdown these "groupLayer" and see the content.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'd like to do is to implement a function that hide the groupLayer content in the TOC. I'd like to be able to define which grouplayers' children&amp;nbsp; I want to hide in the Table of Content config.xml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for example: this is my MapService:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;//Server/ArcGIS/rest/services/MyMapService/MapServer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Layer (1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Layer (2) &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;(GroupLayer)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;______- Layer(3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;______- Layer(4)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Layer (5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like to be able to add in the TOC config.xml something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;hideChildren&amp;gt; //Server/ArcGIS/rest/services/MyMapService/MapServer/2 &amp;lt;/hideChildren&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the TOC.as :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried to use "_tocRoots.removeItemAt"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I saw that "unregisterMapLayer" can hide a MapServices and I tried to recreate the same thing for the tocItem.children but I struggle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Some help would be very appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 May 2011 07:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/layerlist-toc-hide-children/m-p/625771#M13912</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2011-05-14T07:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: LayerList TOC Hide Children</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/layerlist-toc-hide-children/m-p/625772#M13913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to get my "hideChildren" function working.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So far I managed to hide the children of a MapService (Layer) but I didn't find a way of hiding the children of a particular GroupLayer in the MapService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To hide the Children of the MapService:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;In TOCWidget.mxml:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var lyr:Layer = ViewerContainer.getInstance().mapManager.map.getLayer("myLayer");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;toc.hideChildren(lyr); &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;In TOC.as:&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public function hideChildren(layer:Layer):void{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var tocItem:TocMapLayerItem;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if(_mapLayerItems[layer]) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tocItem = _mapLayerItems[layer];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} else {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tocItem = new TocMapLayerItem(layer,_labelFunction,_isMapServiceOnly);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_mapLayerItems[layer] = tocItem;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (tocItem.children){&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tocItem.children = null;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (_tocRoots)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for (var i:int = _tocRoots.length - 1; i &amp;gt;= 0; i--)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if (TocItem(_tocRoots&lt;I&gt;).parent === tocItem.parent)&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;_tocRoots.removeItemAt(i);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it keeps the TopLevel of the tree visible and hide the children in the Table Of Content, if the Children are turned on, they are still visible on the map (that's what I want) they are just "hidden" in the TOC tree.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's a start but it's not quite what I want to achieve. I'd like to hide the Children of a specific GroupLayer within the MapService and not all the childrens of the MapServices.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 02:22:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/layerlist-toc-hide-children/m-p/625772#M13913</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2011-05-17T02:22:57Z</dc:date>
    </item>
  </channel>
</rss>

