OnRenderEnd event

688
2
05-07-2013 01:54 PM
BrianBeck
New Contributor III
I have not been able to find any events either on the Map or FeatureLayer objects that can be connected to for when a layer has finished rendering on the map.  I have code that sets the Renderer of a FeatureLayer dynamically based on user input.  When I call FeatureLayer.redraw() the layer shows the new symbology on the map, but my legend doesn't update until I call legend.refresh().

I have wrapped my Renderer code in its own custom widget, which is not aware of the legend.  What I would like to do is connect the legend.refresh() to either a map event or layer event.  The ideal event would be one that is fired when a layer (or the map) finishes drawing, but I haven't found an event in the API for onDrawEnd of the Map or FeatureLayer.

Is there an event that is fired when a layer or the map finishes drawing even if the extent hasn't changed?
0 Kudos
2 Replies
NiranjanBorawake
New Contributor
Hello Brian,

I think you are looking for onUpdateEnd event of FeatureLayer.

Please have a look at this example and understand how "onUpdateEnd" event is used.

Thanks,
Niranjan
0 Kudos
BrianBeck
New Contributor III
Hello Brian,

I think you are looking for onUpdateEnd event of FeatureLayer.

Please have a look at this example and understand how "onUpdateEnd" event is used.

Thanks,
Niranjan


Thanks Niranjan,

I looked into the "onUpdateEnd" event and unfortunately this isn't quite what I need.  The "onUpdateEnd" event only occurs when the FeatureLayer content is refreshed.  I am using the "redraw" method of the FeatureLayer to redraw the layer with the new symbology because I do not want to requery the server.  The "redraw" method does not update content in the FeatureLayer so the "onUpdateEnd" event is not triggered.

I guess what I really need is an "onDrawEnd" event.
0 Kudos