Select to view content in your preferred language

Event for addition of FeatureLayers to the map.

767
2
04-22-2011 08:43 AM
SanajyJadhav
Deactivated User
Hi,

I am adding 3 dynamic services to the map.Then I add 12 feature layers which come from feature service.Mode for these Feature layers is OnDemand.Normally, it takes bit of long time to completely render the features in the initial extent of the map.

I want to show my users a modal progress bar so that they do not mess the apps while layers are being added to the map and so, I am looking for a event that would tell me that all layers are added to the map and apps is ready to use.

I tried using Map_Progress, Layers:;LayersInitialised and FeatureLayer::UpdateCompleted event for this purpose,but nothing seems to help me.They do not tell me the exact moment when all layers are added.

I found FeatureLayer::UpdateCompleted very useful,but it is depending upon current extent of the map.Not every time for a given extent all feature layers would be queried.This means that,FeatureLayer::UpdateCompleted may not get triggered for every feature layer.This is related to the extent of the map.

Can anybody tell me,is there any specific event that would fulfill my requirement?I want to catch that exact moment when all layers are added to the application.

Thanks,
Sanjay J.
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
You are correct in that if FeatureLayer.Mode is OnDemand, every Map.ExtentChanged event will trigger an update that raises FeatureLayer.UpdateCompleted. This is the event that gets raised after query to the service is complete and graphics are added to your layer. You can subscribe to this event for every layer and set boolean if you're only concerned about the initial loading of graphics. But yeah you are on the right track, this is the event that you need to work on.
0 Kudos
SanajyJadhav
Deactivated User
Thanks Jenn for the reply.

I would put some logic in this event and see if I can go ahead.

Sanjay.
0 Kudos