I'm only just getting into dojo, so I have what most would probably consider a very basic question. I've built my own legend in a div and added divs for the legend items. This is all quite manual, but I just can't get my head around the dojo dijits. I've written the code to toggle the divs on and off (just changing their background colour), but what I now need to add is the code to show or hide the layers from the map.
How can I use the ArcGISDynamicMapServiceLayer object I created to show and hide that entire service on the map after it's been constructed? All the examples I've seen look at the service and then list the layers inside it. I just want to add/remove or show/hide the entire service.