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

585
2
05-05-2010 01:38 PM
PaigeBaldassaro
New Contributor
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?

Paige
0 Kudos
2 Replies
by Anonymous User
Not applicable
you can use onLayersAddResult(results) in javascript API 2.0
0 Kudos
PaigeBaldassaro
New Contributor
I'll keep that in mind. Thanks for the reply. I wound up finding Layer:onUpdate for adding and map:onRemoveLayer for removing.
0 Kudos