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'); } });
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.