Have you considered using the LayerList widget? This provides a list of the layers in the map and the ability to switch on/off the visibility of each layer. The position of layers in the list determines their position in the map, and if one layer is "toggled off", it will maintain its position in the map when toggled back on.
Here's a couple of samples that use the LayerList widget:
Hope this helps!