Solved! Go to Solution.
Hi
Thanks for that.
I've been experimenting with putting this into the code, but so far, not got it working. I'm not entirely clear where I need to put it.
I'm basically using code very similar to this example here:
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_dynamiclay...
How would you suggest it can be incorporated into this example?
I've tried putting:
dojo.connect(dynamicLayer, "onVisibilityChange",handleVisibilityChange);
within the init() function, and I've also tried putting it just before
map.addLayer(layer)
within the buildLayerList function (swapping the first parameter to just be "layer").
My handleVisibilityChange() function is never called.
I could be doing something very wrong here, so advice on how to get this working would be great!
Thanks.
Hi
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.checked) {
visible.push(inputs.id);
}
}
dynamicLayer.setVisibleLayers(visible);
}
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?
Hi
Thanks for that.
I've been experimenting with putting this into the code, but so far, not got it working. I'm not entirely clear where I need to put it.
I'm basically using code very similar to this example here:
http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_dynamiclay...
How would you suggest it can be incorporated into this example?
I've tried putting:
dojo.connect(dynamicLayer, "onVisibilityChange",handleVisibilityChange);
within the init() function, and I've also tried putting it just before
map.addLayer(layer)
within the buildLayerList function (swapping the first parameter to just be "layer").
My handleVisibilityChange() function is never called.
I could be doing something very wrong here, so advice on how to get this working would be great!
Thanks.
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.