<?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: Dynamic Map Service Sublayer Visibility in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546352#M15433</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Colter,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; The only option I can think of is for you to modify the code in the com/esri/viewer/components/toc/tocClasses/TocMapLayerItem.as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prevent the createChildren function from occurring if the layer name equaled your layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't forget to &lt;/SPAN&gt;&lt;STRONG&gt;click the Mark as answer check&lt;/STRONG&gt;&lt;SPAN&gt; and to &lt;/SPAN&gt;&lt;STRONG&gt;click the top arrow (promote)&lt;/STRONG&gt;&lt;SPAN&gt; as shown below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;IMG src="http://gis.calhouncounty.org/FlexViewer2.5/Answer.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2012 02:08:15 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2012-03-15T02:08:15Z</dc:date>
    <item>
      <title>Dynamic Map Service Sublayer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546351#M15432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi All!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a multi-layered map service that I would like to deploy as a dynamic layer in Flex.&amp;nbsp; The trick is that I want the user to only have the ability to turn the entire service on or off (and not individual sublayers).&amp;nbsp; From the forum threads that are similar to mine, it seems unlikely that I can pull this off, but has anyone tried this?&amp;nbsp; A map cache is a potential back-up option, but the dynamic layer would be easier to update!&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Colter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Mar 2012 17:33:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546351#M15432</guid>
      <dc:creator>ColterSikora1</dc:creator>
      <dc:date>2012-03-14T17:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Map Service Sublayer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546352#M15433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Colter,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; The only option I can think of is for you to modify the code in the com/esri/viewer/components/toc/tocClasses/TocMapLayerItem.as&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;prevent the createChildren function from occurring if the layer name equaled your layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't forget to &lt;/SPAN&gt;&lt;STRONG&gt;click the Mark as answer check&lt;/STRONG&gt;&lt;SPAN&gt; and to &lt;/SPAN&gt;&lt;STRONG&gt;click the top arrow (promote)&lt;/STRONG&gt;&lt;SPAN&gt; as shown below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;IMG src="http://gis.calhouncounty.org/FlexViewer2.5/Answer.jpg" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2012 02:08:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546352#M15433</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-03-15T02:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Map Service Sublayer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546353#M15434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert for pointing me in this direction!&amp;nbsp; I got to a point in the .as code where I can stop a sublayer from displaying completely.&amp;nbsp; However, I still want the data to display if the root layer is activated.&amp;nbsp; This is the code I am working with at the moment:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; if (layerInfos)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; var rootLayers:Array = findRootLayers(layerInfos);
&amp;nbsp;&amp;nbsp; for each (var layerInfo:LayerInfo in rootLayers)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; var name:String = layerInfo.name;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (name=='Transportation Projects')
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp; //&amp;nbsp; addChild(createTocLayer(this, layerInfo, layerInfos, visibleLayers, layer));
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; else
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addChild(createTocLayer(this, layerInfo, layerInfos, visibleLayers, layer));
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With the code as-is, the layer Transportation Projects (which is a group layer within a map service) will not display.&amp;nbsp; I would assume if I can remove the right arguements from the 'addChild' code, I can make the layer continue to display, without allowing the user to drill into the sublayers.&amp;nbsp; When I attempt to change the 'addChild' code, I get a variety of errors, since I am messing with properties.&amp;nbsp; Any ideas to work around this?&amp;nbsp; Thank you for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Colter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:38:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546353#M15434</guid>
      <dc:creator>ColterSikora1</dc:creator>
      <dc:date>2021-12-11T23:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Map Service Sublayer Visibility</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546354#M15435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Colter,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; You are getting really deep in the weeds of some very compilated stuff here and I would even have to spend some time examining the paths of the code to figure out if what you want to do is possible (whic likely is). I just don't know the answer right off and don't have the free time to figure this out. I would start by looking at the actual createTocLayer function and maybe prevent the loop from happen for the sublayers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 01:35:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/dynamic-map-service-sublayer-visibility/m-p/546354#M15435</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-03-16T01:35:48Z</dc:date>
    </item>
  </channel>
</rss>

