Select to view content in your preferred language

Populating LayerListWidget.xml

931
6
08-26-2010 09:59 AM
jameshawks
Deactivated User
How do I populate the LayerListWidget.xml? The instructions are underwhelming. Theres a tag for exclude but whats the tag for include? <includelayyer> I'm guessing. So I manually populate the LayerListWidget.xml like so:


<includelayer>APPROACH_HARBOR.BOYISD</includelayer>
<includelayer>APPROACH_HARBOR.BOYLAT</includelayer>
<includelayer>APPROACH_HARBOR.BOYSAW</includelayer>

etc ?
Tags (2)
0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
James,

  If you look at the code in the LayerListWidget.mxml you will see that it adds all map services that are used in your map except for basemaps and any layers you include in the excludelayer list.
0 Kudos
BjornSvensson
Esri Regular Contributor
In general, the best place (if you're not a hard-code developer) is hopefully the documentation in the Flex Viewer resource center 🙂

"The list of layers that appear in the widget are the operational layers listed in the Viewer application's main configuration file. "
[from http://help.arcgis.com/en/webapps/flexviewer/help/index.html#widgets/layerlist_widget.htm]
0 Kudos
BrianGeorge
Emerging Contributor
Here is a new question for this thread---

I have been unsuccessful in trying to exclude an operational layer in the LayerListWidget.xml.

The layer is a single feature from a map service. I have the alpha set at "0" so that it can't be seen and the visibility set as "true" so the SimpleInfoPopup activates. The problem is that I don't want it visible in the LayerList or in the MapSwitcher. I was able to successfully excludelayer in the MapSwitcher Widget, but not finding success with the LayerListWidget config. Below is the xml config... Am I missing something??

Thanks,
Brian

<?xml version="1.0" ?>
<configuration>
    <excludelayer>Lake Erie Public Access IWT</excludelayer>
</configuration>
0 Kudos
DasaPaddock
Esri Regular Contributor
That looks good. Make sure it's not a browser cache issue. Try loading the xml file directly like this to see if it has the latest version:
http://localhost/viewer/widgets/LayerList/LayerListWidget.xml
Also double-check that the value exactly matches the layer's label.
0 Kudos
BrianGeorge
Emerging Contributor
Thanks for the advice! I was able to figure out the problem. The xml had a slight typo.

One more question re: the Info Popups... can alias names be assigned? Currently I'm only able to view the ugly table headers.

Thanks,
Brian
0 Kudos
ChrisChagdes
New Contributor
This maybe a dumb question... but is there a way to include the layer in only the layer list and not in the "More..." list.  In the current setup "More..."  shows all the operational layers which seems to defeat the purpose to me.
0 Kudos