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.

Where can I find an example of a Table of Contents control to plug into the ArcGIS Server JavaScript API 2.3? Ideally it should support feature/dynamic/tiled layers; show symbology; and allow grouped layers. Transparency and zoom-to functionality would be ideal.

The Esri samples page is strangely lacking in any TOC examples - the nearest example is the extremely rudimentary Toggle Layer Visibility.

Answers to Kirk's question show a few templates but they don't contain a decent TOC. The ROK sample is close but doesn't show symbology or support feature layers (as far as I can see).

The TOC on the ArcGIS.com My Map viewer is almost exactly what I need. Has anyone managed to build something similar, or get this TOC working locally?

enter image description here

share|improve this question
    
Something to consider: blog.davebouwman.com/2011/01/05/… –  Derek Swingley Jun 28 '11 at 16:20
    
Derek, I agree that a focussed app is preferable - but sometimes you just need to concede to the user's expectations and provide some fine-grained layer control. The Stamen maps he mentions are awesome, but they each do one very specific thing (often as a proof-of-concept). A paying client often wants a single app which can be used by all staff, and a TOC makes this feasible. It's not so much of a compromise to add a sewer network or some census layers and have them off by default, if it means a whole extra division can suddenly use your site. –  Stephen Lead Jun 28 '11 at 23:05
    
I have to agree with Stephen on this one. While there are times where a TOC shouldn't be used (ie. public facing apps), in many cases what my users are asking for cannot be done without building a TOC (especially when they are actually asking for one). I would consider these people to be "Professional Users". They aren't a GIS professional but require more than what should be offered to the general public. –  Mike Long Aug 31 '11 at 15:57
add comment

4 Answers 4

up vote 6 down vote accepted

Is this what you are looking for? I found it by searching the Code Gallery page on the ArcGIS API for Javascript Resource Center.

share|improve this answer
    
looks promising - I'll give it a go and report back whether it works. Thanks! –  Stephen Lead Jun 28 '11 at 23:08
add comment

Here is a link to another example. This TOC/Legend is automatically generated by the layers in the MXD.

http://stlouis.esri.com/apps/exportmap/

It is part of one of the printing with ArcPy samples located below.

http://blogs.esri.com/Dev/blogs/arcgisserver/archive/2011/04/12/An-introduction-to-arcpy.mapping-for-ArcGIS-Server-developers.aspx

-Mike

share|improve this answer
    
provided 1) link seems to be broken –  Krystian Jan 8 '13 at 15:05
add comment

There's a new TOC sample called Table of Content/Legend Widget for JavaScript API by Nianwei Liu, which fits the bill almost perfectly. It doesn't (seem to) allow feature layers but this is a compromise I can live with since it answers the other requirements very well.

enter image description here

share|improve this answer
add comment

There is a Table of Contents [TOC] Layer with Symbology with ArcGIS Javascript 2.3 is here at the bottom (in the the Footer)

http://help.arcgis.com/en/webapi/javascript/arcgis/demos/ed/ed_selectionmode.html

share|improve this answer
    
not exactly what I was looking for, but it's a nice approach to a TOC (which would probably work well on a tablet, with click on/off toggling). Thanks –  Stephen Lead Jun 28 '11 at 23:11
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.