AnsweredAssumed Answered

Capuring setVisibleLayers() on-complete?

Question asked by ali7789v4 on May 17, 2011
Latest reply on May 19, 2011 by ali7789v4

I'm using some code from the ESRI examples for toggling the layer visiblity. It works well.

function updateLayerVisibility() {
var inputs = dojo.query(".list_item"), input;
visible = [];
for (var i=0, il=inputs.length; i<il; i++) {
   if (inputs[i].checked) {

However, I have some layers which are slow to load - maybe take a couple of seconds. They are slow as they contain a lot of data and we've optimised as much as we can for now.

Is there a way to capture when the setVisibleLayers() has completed? It would be nice to know when it's completed so I can have a "loading" message.

I've had a look on the ESRI API Reference, but there doesn't seem to be a mention of such functionality. Can anyone help?