I have a web app in progress with numerous layers brought in through my ArcGIS Online account. I want to be able to group certain ones together to make the Layer List more organized, and so I can turn off/on layer groups instead of going through it one by one. Does anyone have a solution?
Thanks,
Jacob
Solved! Go to Solution.
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 & 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:
An ESRI example with widgetgroup
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.
Jacob,
You can only accomplish this ArcMap by grouping those layers and republishing the map service.
I had tried that originally and I was getting error messages when I verified the service before publishing.
Jacob,
Not sure why you would be getting an error. I do this all the time.
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 took a few layers out of the original .mxd and group some together in a new .mxd and published that as a service with published fine but the layers are grouped when I bring them into Viewer for Flex.
George, you mentioned stacking widgets in a new widget group. I wasn't aware you were able to do that in viewer for flex. How did you accomplish this?
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 & 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:
An ESRI example with widgetgroup
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.
Do you have a sample app you could send a link to so I could see how this works?
Hi,
I use TOCGroupWidget from How we can make a group of layers?
Thanks for the reply. Which version of flex viewer are you using? I am using 3.7 will it work with that version?