Select to view content in your preferred language

feature layer graphic provider initially empty

861
1
10-30-2012 09:29 AM
PaulHastings1
Deactivated User
dynamically adding some feature layers & trying to add listeners to each graphic in the feature to do some editing. debugging is showing that the feature layers graphic provider is initially empty (or i guess not fully loaded). if the editing mode (snippet shown below) is run a 2nd time, the feature layers graphic providers are filled & the event listeners are added ok.

is there some trick to this? a standard way to make sure the feature layers graphic providers fully loaded?

thanks.

var key:String;
var graphic:Graphic;
for (key in editableLayers) {
 editableLayers[key].visible=true; // show over map service
 for each(graphic in editableLayers[key].graphicProvider) {
  graphic.addEventListener(MouseEvent.CLICK,clickFeatureHandler,false);         
 }
}
Tags (2)
0 Kudos
1 Reply
PaulHastings1
Deactivated User
meh.

swapped the logic around & added event listeners at init time (using an add graphic event). seems to be working ok.
0 Kudos