adding multiple layers dynamically, need to wait for each one to load.

Discussion created by pmbalda on May 5, 2010
Latest reply on May 6, 2010 by pmbalda
I have a recursive call to add multiple services. However, I need to make sure each addLayer doesn't happen till the one before completes. Otherwise, things just don't draw.
Is there some sort of OnAfterMapDraw event?
Alternatively, is there a way to add multiple services at the same time?