# ScaleBar

**URL:** <https://community.thinkgeo.com/t/scalebar/3459>\
**Category:** WPF\
**Created:** [July 8, 2013, 4:53pm UTC](https://community.thinkgeo.com/t/scalebar/3459 "2013-07-08T16:53:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryan6](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@Ryan6](https://community.thinkgeo.com/u/Ryan6)\
**Post date:** [July 8, 2013, 4:53pm UTC](https://community.thinkgeo.com/t/scalebar/3459/1 "2013-07-08T16:53:27Z")

</div>

I&nbsp;noticed&nbsp;that&nbsp;when&nbsp;I&nbsp;add&nbsp;a&nbsp;ScaleBarAdornmentLayer,&nbsp;the&nbsp;panning&nbsp;slows&nbsp;down&nbsp;considerably.&nbsp;Is&nbsp;there&nbsp;something&nbsp;I&nbsp;need&nbsp;to&nbsp;add?&nbsp;FYI,&nbsp;background&nbsp;map&nbsp;is&nbsp;a&nbsp;GoogleMapsLayer.&nbsp;Here&nbsp;is&nbsp;my&nbsp;code:  
  
  
  
ScaleBarAdornmentLayer&nbsp;scale&nbsp;=&nbsp;new&nbsp;ScaleBarAdornmentLayer();  
  
scale.Location&nbsp;=&nbsp;AdornmentLocation.LowerLeft;  
  
m\_Map.AdornmentOverlay.Layers.Add(scale);

---

<div class="post-metadata">

**Author:** ![Summer1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@Summer1](https://community.thinkgeo.com/u/Summer1)\
**Post date:** [July 8, 2013, 9:55pm UTC](https://community.thinkgeo.com/t/scalebar/3459/2 "2013-07-08T21:55:09Z")

</div>

Hi&nbsp;Ryan,

Thanks&nbsp;for&nbsp;your&nbsp;post,&nbsp;we&nbsp;tried&nbsp;to&nbsp;recreate&nbsp;the&nbsp;problem,&nbsp;but&nbsp;it&nbsp;didn't&nbsp;show&nbsp;up,&nbsp;following&nbsp;is&nbsp;our&nbsp;test&nbsp;result(we&nbsp;tested&nbsp;five&nbsp;times):  
  
with&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scale(ms):&nbsp;&nbsp;8242&nbsp;&nbsp;8340&nbsp;8139&nbsp;7620&nbsp;7919  
  
without&nbsp;scale(ms):&nbsp;7697&nbsp;&nbsp;8113&nbsp;9386&nbsp;7680&nbsp;7862

Attached&nbsp;is&nbsp;our&nbsp;test&nbsp;code,&nbsp;would&nbsp;you&nbsp;please&nbsp;check&nbsp;it&nbsp;and&nbsp;tell&nbsp;us&nbsp;what&nbsp;we&nbsp;missed?

Waiting&nbsp;for&nbsp;your&nbsp;further&nbsp;information

Summer&nbsp;

[001\_Post11391.txt](https://community.thinkgeo.com/uploads/default/original/2X/2/2938a1ef6139fb353d83ceedca13ce2dcd3f1d4d.txt) (1.27 KB)

---

<div class="post-metadata">

**Author:** ![Ryan6](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@Ryan6](https://community.thinkgeo.com/u/Ryan6)\
**Post date:** [July 9, 2013, 3:38pm UTC](https://community.thinkgeo.com/t/scalebar/3459/3 "2013-07-09T15:38:51Z")

</div>

I&nbsp;tried&nbsp;your&nbsp;example.&nbsp;Removed&nbsp;all&nbsp;my&nbsp;setup&nbsp;code&nbsp;and&nbsp;inserted&nbsp;your&nbsp;code.&nbsp;The&nbsp;code&nbsp;I&nbsp;used&nbsp;is&nbsp;below.&nbsp;I’m&nbsp;still&nbsp;getting&nbsp;identical&nbsp;behaviour&nbsp;as&nbsp;before,&nbsp;a&nbsp;very&nbsp;noticeable&nbsp;delay&nbsp;in&nbsp;panning.&nbsp;When&nbsp;I&nbsp;comment&nbsp;out&nbsp;the&nbsp;scalebar&nbsp;code&nbsp;it&nbsp;works&nbsp;fine.  
  
  
  
m\_Map.MapUnit&nbsp;=&nbsp;GeographyUnit.Meter;  
m\_Map.CurrentExtent&nbsp;=&nbsp;new&nbsp;RectangleShape(-2500000,&nbsp;2500000,&nbsp;2500000,&nbsp;-2500000);  
m\_Map.ZoomLevelSet&nbsp;=&nbsp;new&nbsp;OpenStreetMapsZoomLevelSet();  
  
  
  
LayerOverlay&nbsp;ov&nbsp;=&nbsp;new&nbsp;LayerOverlay();  
ov.Layers.Add(new&nbsp;GoogleMapsLayer());  
[//ov.Drawing](https://ov.Drawing)&nbsp;+=&nbsp;new&nbsp;System.EventHandler\<DrawingOverlayEventArgs\>(ov\_Drawing);  
  
[//ov.Drawn](https://ov.Drawn)&nbsp;+=&nbsp;new&nbsp;System.EventHandler\<DrawnOverlayEventArgs\>(ov\_Drawn);  
  
  
  
&nbsp;ScaleBarAdornmentLayer&nbsp;scale&nbsp;=&nbsp;new&nbsp;ScaleBarAdornmentLayer();  
&nbsp;scale.Location&nbsp;=&nbsp;AdornmentLocation.LowerLeft;  
&nbsp;m\_Map.AdornmentOverlay.Layers.Add(scale);  
&nbsp;m\_Map.Overlays.Add(“ov”,&nbsp;ov);  
&nbsp;m\_Map.Refresh();

---

<div class="post-metadata">

**Author:** ![Summer1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@Summer1](https://community.thinkgeo.com/u/Summer1)\
**Post date:** [July 9, 2013, 8:58pm UTC](https://community.thinkgeo.com/t/scalebar/3459/4 "2013-07-09T20:58:35Z")

</div>

Hi&nbsp;Ryan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;further&nbsp;information,&nbsp;&nbsp;Our&nbsp;code&nbsp;is&nbsp;tested&nbsp;with&nbsp;the&nbsp;latest&nbsp;version&nbsp;of&nbsp;dlls(7.0.23.0),&nbsp;would&nbsp;you&nbsp;please&nbsp;get&nbsp;7.0.23.0&nbsp;and&nbsp;try&nbsp;it&nbsp;again,&nbsp;you&nbsp;could&nbsp;get&nbsp;it&nbsp;from&nbsp;you&nbsp;customer&nbsp;portal:&nbsp;[helpdesk.thinkgeo.com/login/?ReturnUrl=%2F](http://helpdesk.thinkgeo.com/login/?ReturnUrl=%2f)&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;the&nbsp;problem&nbsp;is&nbsp;still&nbsp;there,&nbsp;would&nbsp;you&nbsp;please&nbsp;tell&nbsp;us&nbsp;your&nbsp;culture&nbsp;info,&nbsp;OS&nbsp;for&nbsp;a&nbsp;further&nbsp;test?&nbsp;  
&nbsp;&nbsp;  
&nbsp;Waiting&nbsp;for&nbsp;your&nbsp;further&nbsp;information&nbsp;  
&nbsp;&nbsp;  
&nbsp;Summer

---

<div class="post-metadata">

**Author:** ![Ryan6](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@Ryan6](https://community.thinkgeo.com/u/Ryan6)\
**Post date:** [July 11, 2013, 5:37pm UTC](https://community.thinkgeo.com/t/scalebar/3459/5 "2013-07-11T17:37:09Z")

</div>

I&nbsp;grabbed&nbsp;version&nbsp;7.0.31.&nbsp;I&nbsp;have&nbsp;the&nbsp;same&nbsp;issue.&nbsp;  
&nbsp;&nbsp;  
&nbsp;I’m&nbsp;running&nbsp;Windows&nbsp;7,&nbsp;Visual&nbsp;Studio&nbsp;2010,&nbsp;.NET&nbsp;Framework&nbsp;4.&nbsp;I’ve&nbsp;tried&nbsp;debug&nbsp;and&nbsp;release&nbsp;modes.

---

<div class="post-metadata">

**Author:** ![Summer1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@Summer1](https://community.thinkgeo.com/u/Summer1)\
**Post date:** [July 12, 2013, 1:56am UTC](https://community.thinkgeo.com/t/scalebar/3459/6 "2013-07-12T01:56:47Z")

</div>

Hi&nbsp;Ryan,&nbsp;&nbsp;  
  
  
  
Sorry&nbsp;for&nbsp;the&nbsp;inconvenience,&nbsp;but&nbsp;I&nbsp;am&nbsp;sorry&nbsp;to&nbsp;say&nbsp;that&nbsp;we&nbsp;tested&nbsp;the&nbsp;exact&nbsp;code&nbsp;with&nbsp;yours&nbsp;on&nbsp;a&nbsp;pure&nbsp;virtual&nbsp;machine(win&nbsp;7,&nbsp;.net&nbsp;4),&nbsp;but&nbsp;the&nbsp;problem&nbsp;still&nbsp;didn’t&nbsp;show&nbsp;up,&nbsp;following&nbsp;is&nbsp;a&nbsp;captured&nbsp;video&nbsp;of&nbsp;our&nbsp;test,&nbsp;would&nbsp;you&nbsp;please&nbsp;check&nbsp;it:&nbsp;[screencast.com/t/5VZra1oKtoJ3](http://screencast.com/t/5VZra1oKtoJ3)&nbsp;.&nbsp;If&nbsp;possible,&nbsp;would&nbsp;you&nbsp;please&nbsp;send&nbsp;us&nbsp;a&nbsp;small&nbsp;“self-contained”&nbsp;sample&nbsp;to&nbsp;recreate&nbsp;it?&nbsp;  
  
  
  
Waiting&nbsp;for&nbsp;your&nbsp;further&nbsp;information.&nbsp;  
  
  
  
Best&nbsp;Regards&nbsp;  
  
  
  
Summer&nbsp;

---

<div class="post-metadata">

**Author:** ![Ryan6](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@Ryan6](https://community.thinkgeo.com/u/Ryan6)\
**Post date:** [July 12, 2013, 4:54pm UTC](https://community.thinkgeo.com/t/scalebar/3459/7 "2013-07-12T16:54:01Z")

</div>

It&nbsp;was&nbsp;a&nbsp;little&nbsp;difficult&nbsp;to&nbsp;tell&nbsp;from&nbsp;the&nbsp;video.&nbsp;I’ve&nbsp;attached&nbsp;a&nbsp;project&nbsp;that&nbsp;should&nbsp;show&nbsp;the&nbsp;problem.&nbsp;Without&nbsp;the&nbsp;scalebar&nbsp;layer,&nbsp;it&nbsp;pans&nbsp;smoothly&nbsp;as&nbsp;you&nbsp;drag&nbsp;the&nbsp;mouse.&nbsp;With&nbsp;the&nbsp;scalebar,&nbsp;there&nbsp;is&nbsp;a&nbsp;delay&nbsp;between&nbsp;mouse&nbsp;drag&nbsp;and&nbsp;pan.  
  
[002\_001\_ScaleBarTest.zip](https://community.thinkgeo.com/uploads/default/original/2X/b/befd8171c22742b0cf9cd4f1dcc6dccf719fea87.zip) (58.1 KB)

---

<div class="post-metadata">

**Author:** ![Summer1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@Summer1](https://community.thinkgeo.com/u/Summer1)\
**Post date:** [July 15, 2013, 4:16am UTC](https://community.thinkgeo.com/t/scalebar/3459/8 "2013-07-15T04:16:24Z")

</div>

Hi&nbsp;Ryan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;sample&nbsp;and&nbsp;sorry&nbsp;for&nbsp;misunderstanding&nbsp;the&nbsp;problem,&nbsp;at&nbsp;first&nbsp;I&nbsp;thougth&nbsp;the&nbsp;problem&nbsp;is&nbsp;the&nbsp;rendering&nbsp;speed&nbsp;difference&nbsp;between&nbsp;with&nbsp;scalebar&nbsp;and&nbsp;without&nbsp;scalebar,&nbsp;but&nbsp;now&nbsp;I&nbsp;have&nbsp;understand&nbsp;your&nbsp;problem&nbsp;which&nbsp;is&nbsp;the&nbsp;pan&nbsp;delay&nbsp;with&nbsp;scale&nbsp;bar,&nbsp;this&nbsp;problem&nbsp;is&nbsp;a&nbsp;little&nbsp;complex&nbsp;and&nbsp;will&nbsp;need&nbsp;a&nbsp;little&nbsp;bit&nbsp;time&nbsp;to&nbsp;sort&nbsp;it&nbsp;out,&nbsp;would&nbsp;you&nbsp;please&nbsp;wait&nbsp;a&nbsp;little&nbsp;while&nbsp;for&nbsp;it?&nbsp;Any&nbsp;thing&nbsp;new&nbsp;will&nbsp;be&nbsp;updated&nbsp;here&nbsp;immediately.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Best&nbsp;Regards&nbsp;  
&nbsp;&nbsp;  
&nbsp;Summer

---

<div class="post-metadata">

**Author:** ![Summer1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/c89c15/32.png) [@Summer1](https://community.thinkgeo.com/u/Summer1)\
**Post date:** [July 15, 2013, 11:59pm UTC](https://community.thinkgeo.com/t/scalebar/3459/9 "2013-07-15T23:59:25Z")

</div>

Hi&nbsp;Ryan,

Would&nbsp;you&nbsp;please&nbsp;try&nbsp;the&nbsp;attached&nbsp;sample,&nbsp;it&nbsp;should&nbsp;work&nbsp;now.

Hope&nbsp;it&nbsp;helps

Summer

[003\_002\_001\_ScaleBarTest.zip](https://community.thinkgeo.com/uploads/default/original/2X/1/1a7452c704f3ab87cb58796ddb8e4ad38fa1edaa.zip) (8.53 KB)

---

<div class="post-metadata">

**Author:** ![Ryan6](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/c77e96/32.png) [@Ryan6](https://community.thinkgeo.com/u/Ryan6)\
**Post date:** [July 16, 2013, 12:18pm UTC](https://community.thinkgeo.com/t/scalebar/3459/10 "2013-07-16T12:18:19Z")

</div>

It&nbsp;works.&nbsp;Thanks!

---

<div class="post-metadata">

**Author:** ![Johnny](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/johnny/32/19044_2.png) [@Johnny](https://community.thinkgeo.com/u/Johnny)\
**Post date:** [July 17, 2013, 4:27am UTC](https://community.thinkgeo.com/t/scalebar/3459/11 "2013-07-17T04:27:17Z")

</div>

Hi&nbsp;Ryan,&nbsp;  
&nbsp;&nbsp;  
&nbsp;You&nbsp;are&nbsp;welcome.&nbsp;If&nbsp;any&nbsp;other&nbsp;questions,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Johnny
