onLayerAdd vs onLayerAddResult events

740
1
04-05-2012 02:24 PM
JohnCartwright
Occasional Contributor
Hello All,

Can someone please clarify for me the differences between the onLayerAdd and onLayerAddResult events on the esri.Map class?

Why would one choose not to use the new onLayerAddResult instead of the onLayerAdd?

Thanks!

--john
0 Kudos
1 Reply
derekswingley1
Frequent Contributor
Hi John,

onLayerAdd fires as soon as a layer is added to a map. onLayerAddResult fires after a add operation succeeded or failed. If you want to be notified when a layer is added, you probably want onLayerAddResult as you'll be able to check for success or failure.
0 Kudos