Select to view content in your preferred language

Progress bar while adding ArcGISDynamicMapServiceLayer to map

2986
2
Jump to solution
07-10-2014 06:59 AM
BhavinSanghani
Frequent Contributor

I add ArcGISDynamicMapServiceLayer to map using following code. It's added successfully and shows the map as expected. When the map is loading, I want to mask the screen. I am doing it as per following code (see bold comments). Now, if map image is taking time to load then which event I can capture so, I can unmask in that event? I added map-image-export to the dynamiclayer but it never gets called from the api. I see from the fiddler that export image url is in progress but 'layer-add-result' gets executed. It seems if map image takes time to load, then API is firing export url explicitly and load the map in configured div. Does API sends status of map loading in any callback function?

//masking here

vDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(vURL, {

  'opacity' : 1,

  'imageParameters' : vImageParameters

  });

vMap = new Map(vMapDiv, {

  sliderOrientation: 'vertical',

  infoWindow: vPopup,

  autoResize: true,

  logo: false

  });

vDynamicMapServiceLayer.on('map-image-export', function() {

//unmask here

  });

vMap.on('layer-add-result', function() {

//unmasking here

  }, error);

vMap.addLayer(vDynamicMapServiceLayer);

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

The ArcGISDynamicMapServiceLayer does have a load event that you can listen for, which fires after layer properties for the layer are successfully populated. There are also update, update-start, and update-end events.

View solution in original post

0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor

The ArcGISDynamicMapServiceLayer does have a load event that you can listen for, which fires after layer properties for the layer are successfully populated. There are also update, update-start, and update-end events.

0 Kudos
BhavinSanghani
Frequent Contributor

Actually, I tried out update-end after posting the question and it worked for me. Thanks!

0 Kudos