Best practice to show load icon

2683
2
Jump to solution
10-03-2014 08:21 AM
LeiZhong
New Contributor

I have a base map, and then load a large csvLayer (over 5,000points) on top of it. I'd like to show the load icon until the csvLayer is fully loaded. How would I setup the event? On layer load or map load?  I'm new to AMD style and still not very familiar the javascript api. Some ESRI examples have:

dojo.connect(map, "onUpdateEnd", updateEnd);

So I did

map.on("onUpdateEnd", hideLoading")   (on line 60 of attached file)

but the hideLoading is never triggered. Should I do it on a layer instead of layer? Thanks!

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

When you use "on" style of events in AMD, the events have a different name. You would use "update-end" instead of "onUpdateEnd".

This sentence in the Events page explains it.

The other important difference, is event names. New on style event names are lowercased, words are hyphen separated, and there is no "on" prefix.

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

When you use "on" style of events in AMD, the events have a different name. You would use "update-end" instead of "onUpdateEnd".

This sentence in the Events page explains it.

The other important difference, is event names. New on style event names are lowercased, words are hyphen separated, and there is no "on" prefix.

LeiZhong
New Contributor

Yup, that did it. Thanks!

0 Kudos