Is an event fired when the map stops drawing?

865
5
08-29-2010 04:09 PM
StephenLead
Regular Contributor III
I'd like to add a "waiting" animation to my JS map, as in the sample at http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/map_showloadin...

In this sample, "the map's onLoad, onZoomStart,      and onPanStart events cause the loading icon to appear. The layers' onUpdate     events cause the icon to go away."

This requires listening for the onUpdate event on every layer that you add to the map, and anticipating every event which could cause the map to redraw (pan/zoom, previous/next extent, time slider change, etc).

Is there a way to listen at the map level, rather than the layer level? ie, is there an event fired when the map has finished doing everything? What is the last event fired by the map when it redraws for whatever reason?

Thanks,
Steve
0 Kudos
5 Replies
GlenRhea
New Contributor
I am interested in this as well...
0 Kudos
GeorgieCassar
Occasional Contributor
Use map.onUpdateEnd()
0 Kudos
StephenLead
Regular Contributor III
Thanks Georgie.

OnUpdateEnd was added for the v2.2 release - I'd like to think as a result of this forum post 😉
0 Kudos
Todd
by
New Contributor III
(broken link)
Regards,
Todd
0 Kudos
StephenLead
Regular Contributor III
(broken link)


Hi Todd,

The new syntax is

map.on("update-end", function() {
  //do something
});


See https://developers.arcgis.com/en/javascript/jsapi/map-amd.html#update-end

Cheers,
Steve
0 Kudos