# Using a progress bar for loading layers

**URL:** <https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318>\
**Category:** WinForms\
**Created:** [March 30, 2009, 8:54am UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318 "2009-03-30T08:54:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nelson](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/n/dec6dc/32.png) [@Nelson](https://community.thinkgeo.com/u/Nelson)\
**Post date:** [March 30, 2009, 8:54am UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/1 "2009-03-30T08:54:08Z")

</div>

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

&nbsp;

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

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [April 2, 2009, 10:25am UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/2 "2009-04-02T10:25:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Nelson](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/n/dec6dc/32.png) [@Nelson](https://community.thinkgeo.com/u/Nelson)\
**Post date:** [April 2, 2009, 12:44pm UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/3 "2009-04-02T12:44:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![David](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@David](https://community.thinkgeo.com/u/David)\
**Post date:** [April 7, 2009, 10:01pm UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/4 "2009-04-07T22:01:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Syed\_Moshiur](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Syed\_Moshiur](https://community.thinkgeo.com/u/Syed_Moshiur)\
**Post date:** [February 3, 2017, 10:43am UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/5 "2017-02-03T10:43:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [February 4, 2017, 9:49am UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/6 "2017-02-04T09:49:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Syed\_Moshiur](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@Syed\_Moshiur](https://community.thinkgeo.com/u/Syed_Moshiur)\
**Post date:** [February 6, 2017, 10:21am UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/7 "2017-02-06T10:21:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Peter](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/peter/32/19042_2.png) [@Peter](https://community.thinkgeo.com/u/Peter)\
**Post date:** [February 7, 2017, 5:57am UTC](https://community.thinkgeo.com/t/using-a-progress-bar-for-loading-layers/318/8 "2017-02-07T05:57:46Z")

</div>

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
