Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering if anybody has idea for how to best group distinct layers -- even layers of differing types like DynamicLayer, WFSLayer, etc. The goal in mind is that they could be visually represented together in a TOC component and they could be toggled on and off as a group in the TOC.

The TOC component which comes with the out of the box Flex Viewer is setup to do this for ArcGISDynamicMapServiceLayers -- which have the layerInfo property that informs of the parent/child relationships.

The question is -- has anybody done this before and if so, what is the best way to accomplish this? I was considering creating a LayerGroup object which extends the base Layer object and has a layerInfo property that stores a custom LayerInfo object -- similar to how the WMSLayerInfo is used to store parent/child relationships for WMSLayers.

share|improve this question
It sounds like you are trying to group (actual) layers that come from different services (what the Flex API tends to call layers). I doubt the standard TOC would be able to handle this nicely. – Anthony -GISCOE- Mar 21 '11 at 17:50
@Anthony -- that's correct. Yeah, we're starting to build a custom TOC component to meet this requirement. – ghoti143 Mar 22 '11 at 13:07
When you're working with the ArcGISDynamicMapServiceLayers, the relationship between group layers and the visibleLayers property of the layer is different from how it works in ArcMap - adding a group layer to the visible list turns on all sublayers, and sublayers listed as visible are still visible if their group isn't listed as visible. A TOC control for those will have to keep track of what the user has checked and translate it. – Dan Monego Mar 23 '11 at 1:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.