on(map, "layer-add-result", function(layerAdded, errorMsg){ if(layerAdded.layer === myLayer){ console.log('found the layer i want, do something specific'); } });
The 'layer-add-result' event actually returns the layer that was added to the map in the callback.You would have to check in the callback which layer was added and then do something based on that.http://jsfiddle.net/tE4A3/7/ on(map, "layer-add-result", function(layerAdded, errorMsg){ if(layerAdded.layer === myLayer){ console.log('found the layer i want, do something specific'); } });
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.