Select to view content in your preferred language

Legend - toggle services, not listing all layers for toggle

652
2
Jump to solution
01-09-2013 08:07 AM
DavidBoyd
Emerging Contributor
I referenced the "legend - toggle services" widget sample to update my map.  The legend works great and refreshes better than my last version, but the layer tab just lists the whole map service as one check box...instead of listing the many layers separately, like in the legend.  I'm not sure how to change the script to break out all layers so visibility can be toggled for each one, or if this change would be specific to the legend or checkbox part of the script.  Any suggestions or clues are welcome!  Thanks, David

Here's the map:  http://dswcapps.dcr.virginia.gov/dnh/vop/vop_accordion.htm
0 Kudos
1 Solution

Accepted Solutions
DavideLimosani
Frequent Contributor
I referenced the "legend - toggle services" widget sample to update my map.  The legend works great and refreshes better than my last version, but the layer tab just lists the whole map service as one check box...instead of listing the many layers separately, like in the legend.  I'm not sure how to change the script to break out all layers so visibility can be toggled for each one, or if this change would be specific to the legend or checkbox part of the script.  Any suggestions or clues are welcome!  Thanks, David

Here's the map:  http://dswcapps.dcr.virginia.gov/dnh/vop/vop_accordion.htm


I suggest you to use the TOC widget in this sample https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109

it works well and will save you a lot of time

View solution in original post

0 Kudos
2 Replies
JeffJacobson
Frequent Contributor
If this is the sample you're referring to, it looks like each checkbox controls a separate map service.
0 Kudos
DavideLimosani
Frequent Contributor
I referenced the "legend - toggle services" widget sample to update my map.  The legend works great and refreshes better than my last version, but the layer tab just lists the whole map service as one check box...instead of listing the many layers separately, like in the legend.  I'm not sure how to change the script to break out all layers so visibility can be toggled for each one, or if this change would be specific to the legend or checkbox part of the script.  Any suggestions or clues are welcome!  Thanks, David

Here's the map:  http://dswcapps.dcr.virginia.gov/dnh/vop/vop_accordion.htm


I suggest you to use the TOC widget in this sample https://www.arcgis.com/home/item.html?id=9b6280a6bfb0430f8d1ebc969276b109

it works well and will save you a lot of time
0 Kudos