Select to view content in your preferred language

Exclude layers in TOC

2088
2
02-22-2012 12:24 PM
LeroyChristophersen
Emerging Contributor
I am using the compiled TOC widget from Robert.  I want to exclude some layers from displaying in the TOC, not the map.  The information is needed, but to reduce the confusion for the user, they only need to see certain features in the TOC.  Any suggestion?
Tags (2)
0 Kudos
2 Replies
JasonNielsen
Regular Contributor
I am using the compiled TOC widget from Robert. I want to exclude some layers from displaying in the TOC, not the map. The information is needed, but to reduce the confusion for the user, they only need to see certain features in the TOC. Any suggestion?


Here is what i use to exclude layers in the TOC widget. This is my TOCWidget.xml.

<?xml version="1.0" ?>
<!--
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2010 ESRI
//
// All rights reserved under the copyright laws of the United States.
// You may freely redistribute and use this software, with or
// without modification, provided you include the original copyright
// and use restrictions.  See use restrictions in the file:
// <install location>/FlexViewer/License.txt
//
////////////////////////////////////////////////////////////////////////////////
-->
<configuration>
 <labels>
  <visibilitylabel>Layer Visibility</visibilitylabel>
  <zoomtoextent>Zoom To Layer Extent</zoomtoextent>
  <expandall>Expand All Layers</expandall>
  <collapseall>Collapse All Layers</collapseall>
  <zoomtomakevisible>Zoom To Make Visible</zoomtomakevisible>
  <generatinglegendmsg>Generating TOC Legend</generatinglegendmsg>
 </labels>
 <tocsettings>
  <expanded>false</expanded>
  <collapselegends>false</collapselegends>
 </tocsettings>
 <legendtimeout>60</legendtimeout>
<excludelayers>
  <excludelayer mapservice="Basemap Features">21,29,30,31,32,33,34,35,36,37,38,39,40,42,43,44</excludelayer>
  <excludelayer mapservice="Assessor Information">3,5</excludelayer>
  <excludelayer mapservice="Annexations"></excludelayer>
 </excludelayers>
 <excludegraphiclayers>true</excludegraphiclayers>
 <excludebasemaplayers>true</excludebasemaplayers>
 <usenewesridescription>false</usenewesridescription>
</configuration>


The name of the mapservice is the name you call it in your config.xml file. The number behind that are only excluding those layers from that service from the TOC. If no numbers are listed for a mapservice it excludes the entire mapservice from the TOC.
0 Kudos
LeroyChristophersen
Emerging Contributor
Thanks for the assistance.  I had done this, but the results were not the same.  It turns out I had left out a command character.
0 Kudos