I am going to build a dynamic list of layers and legend items by iterating through the layerInfos of the dynamicMapServiceLayer that I have added to my map.
I have found that I cannot itterate through the layerInfos until after the layer has been added to the map. To detect this I am using the onLayerAdd event. The only way I've been able to use the onLayerAdd event is to also use a dojo.connect
Do I have to use dojo.connect? If so why? It seems like it would make more sense to do something like
Thanks in advance....