Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm still trying to find the perfect Table of Contents sample for the ArcGIS Server JavaScript API 2.3. My previous question gave some hints but I now have a more specific question regarding checkboxes for layer control.

I need to provide a Table of Contents containing a variety of Tiled, Feature and Dynamic layers, which may be sourced from multiple ArcGIS Server instances. The TOC should allow the user to toggle individual layers on/off, and toggle multiple layers on/off simultaneously using a Group layer checkbox (ie, one high-level checkbox to control multiple lower-level layers).

This sample contains a nice Group layer control, but presumes that all the component layers may be switched on/off as VisibleLayers of a single Dynamic layer. This logic seems to be integral to the sample, so it doesn't look like a simple matter to modify it for feature and tiled layers. (Please let me know if I'm on the wrong track, and this sample would prove suitable)

The Legend Widget sample is more suitable as it simply switches any layer on/off (see the Natural Disasters panel on the right-hand side).

My question

How would I add a Group Layer control to the Legend Widget sample? eg, add a higher-level checkbox which will switch both Fire and Earthquakes layers on/off.

share|improve this question
1  
This is obviously something that other people are interested in: forums.arcgis.com/threads/… - it would be great if ESRI could provide a robust TOC sample for the JS API so we could concentrate on more advanced functionality rather than the "plumbing"... –  Stephen Lead Jul 11 '11 at 23:44
add comment

1 Answer

up vote 0 down vote accepted

I haven't implemented it yet, but the sample at http://www.thejekels.com/dojo/Dijit_Tree_Chkbox.html looks suitable. This is what the TOC sample cited above uses. I'll try to customise it for my purposes

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.