Select to view content in your preferred language

Table of Contents / Dynamic Legend with layer on/off capability

662
2
Jump to solution
07-02-2012 11:08 AM
DavidBoyd
Emerging Contributor
I'm relatively new to using the Javascript API and developing web maps.  I'm hoping to find a widget or sample code that allows me to create an interactive legend (table of contents) with symbology and on/off toggle for the map service layers.  Even just a list of the data layers that can be toggled on/off would be great....the legend can be created separately.  Does anything like this exist, or does anyone know of an example I could look at?  It seems like a fairly basic need, but I've been chasing bad links and false leads trying to find it.  Thanks!
0 Kudos
1 Solution

Accepted Solutions
BrettGreenfield__DNR_
Frequent Contributor
Try this code: http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109

That worked for me, but I'm not sure why we have to use a user-created widget instead of something built in to the API.

View solution in original post

0 Kudos
2 Replies
BrettGreenfield__DNR_
Frequent Contributor
Try this code: http://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109

That worked for me, but I'm not sure why we have to use a user-created widget instead of something built in to the API.
0 Kudos
DavidBoyd
Emerging Contributor
Thanks Brett, I used this and it worked really well!!!
0 Kudos