Group layers in Flex viewer

2987
2
11-29-2012 06:08 PM
OznogOznoggg
New Contributor
Hi,
we are three students who have to do some wprk in ArcGIS viewer for flex. We have some layers in ArcGIS Online added to viewer for flex and need to create "group layers" in Layer list. For example,,, we have railway layer, highway layer and road layer... we need to make group of these layers named "comunications". We don't have Arcgis server, so we dont know how to do it and the term of submission is on Saturday night. Please help us, we are helpless.
Tags (2)
0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
To put it simply... You can not... That would have to be done in the MXD  that you are publishing to ArcGIS Server and as you said you do not  have ArcGIS Server.

BTW: I am moving this thread to the ArcGIS Viewer for Flex forum where this thread belongs.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos
HaskettGeorge
New Contributor III

Like Robert mentioned, if you can group them and republish your services, that would be the best bet.

However, if you cannot for whatever reason, you could create multiple layer lists using the default layer list widget that would allow you to group the individual services together as necessary.  For example, you would have (1) layer list for geographic data, another for demographic data, etc.  You could have them side by side in your main widget container or stack them in a new widget group.  I've done both to clean things up a bit.

Its not the ideal way to go about it, but if you are forced to use an excessive amount of layers then it will allow you to control them to some point.

I don't remember how to post code in a nice manner so I'll just copy and post an example:

  <widgetcontainer layout="float">

    <widgetgroup label="Misc Tools" icon="assets/images/i_options.png">

      <widget label="Draw &amp; Measure" url="widgets/eDraw/eDrawWidget.swf" config="widgets/eDraw/eDrawWidget.xml" icon="assets/images/i_measure.png" top="150" right="20" />

      <widget label="Bookmarks" url="widgets/Bookmark/BookmarkWidget.swf" config="widgets/Bookmark/BookmarkWidget.xml" icon="assets/images/i_bookmark.png" top="200" right="20" />

      <widget label="Print" url="widgets/Print/PrintWidget.swf" config="widgets/Print/PrintWidget.xml" icon="assets/images/i_print.png" top="250" right="20" />

    </widgetgroup>\

If you are using something like XML Notepad it would look like this:

widgetGroup.JPG

An ESRI example with widgetgroup

ArcGIS Viewer for Flex

Granted I don't use the App Builder when working with the Viewer for Flex, its too limiting.  I edit the tag references via XML Notepad.

0 Kudos