ThinkGeo.com    |     Documentation    |     Premium Support

Using a progress bar for loading layers

I was wondering if there was a way to use a progress bar to show the user that the layer is loading as a visual cue. If it could be a 0% - 100% scenario that would be great but I'm thinking just a looping progress bar that resets when the layer is done loading would be sufficient too.


 


I've tried using the overlaydrawing type events but I get cross threading issues when trying to apply a value to a progress bar due to the control being generated in a different thread.



Nelson, 
  
   So you would see the progress bar move when it finishes a layer inside of an overlay or for each overlay?  If our event is generate on a different thread then you can still update your progress bar but you need to do an Invoke to send the call back to the UI thread.  Using Invoke is the recommended way to deal with Winforms controls when you are on a separate thread.  Could you consider just an animated circle or something that shows that it is loading but does not indicate progress? 
  
 David

Absolutely. At this point, simply a visual cue that there is loading taking place is sufficient. I’m familiar with using Invoke to affect controls not on the thread it was created on but I wasn’t sure on how to integrate that with the way Map Suite currently operates.

Nelson, 
  
   Let me take a look at this and see what I can come up with. 
  
 David

Hi, ANy update on this matter. I would like to also know the status of my overall status or each layer/overlay busy status!!!

Regards,
Mushed

Hi Mushed,

We still don’t have a loading progress bar for desktop edition.

But we have some event like LayerOverlay.Drawing and LayerOverlay.Drawn, I think you can get the loading status from these events.

Regards,

Don

Thanks Don,
I am aware of the event. Which does not work as reliable as we would like. Specially for WMS overlay Even after overlay is drawn mouse move fires the drawing and drawn events. Our customer wants to see a busy sign when the wms and other online layers are loading data from different sources and then disappear when done loading…

Regards,
Murshed

Hi Murshed,

The tiles are drawn in multi-threads by default. In the mode, the Drawing and Drawn events can’t be fired actually. you can try setting the thread to single.

winformsMap1.ThreadingMode = MapThreadingMode.SingleThreaded

Thanks,
Peter