# Need to Rotae Map PanZoomBar control

**URL:** <https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982>\
**Category:** Silverlight\
**Created:** [December 22, 2011, 9:49pm UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982 "2011-12-22T21:49:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sunil](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@Sunil](https://community.thinkgeo.com/u/Sunil)\
**Post date:** [December 22, 2011, 9:49pm UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/1 "2011-12-22T21:49:02Z")

</div>

Hi

I&nbsp;am&nbsp;using&nbsp;Mapsuite&nbsp;Silverlight&nbsp;edition&nbsp;5.0.

I&nbsp;need&nbsp;to&nbsp;Rotae&nbsp;Map&nbsp;PanZoomBar&nbsp;control&nbsp;by&nbsp;90&nbsp;degree&nbsp;and&nbsp;put&nbsp;it&nbsp;downside&nbsp;with&nbsp;horizontal&nbsp;orientation.

Please&nbsp;check&nbsp;the&nbsp;attached&nbsp;snap&nbsp;shots.

I&nbsp;was&nbsp;able&nbsp;to&nbsp;rotate&nbsp;the&nbsp;control&nbsp;but&nbsp;pan&nbsp;operation&nbsp;is&nbsp;not&nbsp;working&nbsp;as&nbsp;expected.&nbsp;For&nbsp;example,&nbsp;after&nbsp;rotating&nbsp;the&nbsp;control&nbsp;if&nbsp;I&nbsp;click&nbsp;the&nbsp;

"Top&nbsp;Pan"&nbsp;arrow&nbsp;map&nbsp;moves&nbsp;in&nbsp;left&nbsp;direction&nbsp;rather&nbsp;than&nbsp;moving&nbsp;up.

Can&nbsp;you&nbsp;please&nbsp;suggest&nbsp;how&nbsp;should&nbsp;I&nbsp;roatate&nbsp;it&nbsp;and&nbsp;all&nbsp;other&nbsp;functionality&nbsp;work&nbsp;as&nbsp;expected.

&nbsp;

Thanks

Sunil

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [December 23, 2011, 9:48am UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/2 "2011-12-23T09:48:14Z")

</div>

Sunil,

&nbsp;&nbsp;I&nbsp;don't&nbsp;know&nbsp;what&nbsp;you&nbsp;are&nbsp;doing&nbsp;exactely&nbsp;with&nbsp;rotating&nbsp;in&nbsp;your&nbsp;app&nbsp;since&nbsp;we&nbsp;don't&nbsp;have&nbsp;it&nbsp;and&nbsp;you&nbsp;also&nbsp;did&nbsp;not&nbsp;include&nbsp;the&nbsp;snap&nbsp;shots.&nbsp;But&nbsp;as&nbsp;a&nbsp;general&nbsp;recomendation,&nbsp;I&nbsp;would&nbsp;suggest&nbsp;you&nbsp;check&nbsp;the&nbsp;sample&nbsp;Centering&nbsp;and&nbsp;Rotating&nbsp;WPF&nbsp;in&nbsp;the&nbsp;Code&nbsp;Community.&nbsp;It&nbsp;is&nbsp;a&nbsp;Wpf&nbsp;sample&nbsp;but&nbsp;the&nbsp;rotating&nbsp;technique&nbsp;applies&nbsp;for&nbsp;other&nbsp;editions&nbsp;too&nbsp;such&nbsp;as&nbsp;SilverLight.&nbsp;&nbsp;[wiki.thinkgeo.com/wiki/Map\_Suite\_Si...tating\_WPF](http://wiki.thinkgeo.com/wiki/Map_Suite_Silverlight_Edition_Vehicle_Tracking_Samples#Centering_And_Rotating_WPF).&nbsp;If&nbsp;you&nbsp;are&nbsp;still&nbsp;struggling,&nbsp;I&nbsp;suggest&nbsp;you&nbsp;send&nbsp;us&nbsp;a&nbsp;little&nbsp;sample&nbsp;to&nbsp;us.&nbsp;Thank&nbsp;you.

---

<div class="post-metadata">

**Author:** ![Sunil](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/s/5fc32e/32.png) [@Sunil](https://community.thinkgeo.com/u/Sunil)\
**Post date:** [December 25, 2011, 11:25pm UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/3 "2011-12-25T23:25:38Z")

</div>

Hi&nbsp;Val,

I&nbsp;am&nbsp;just&nbsp;trying&nbsp;to&nbsp;change&nbsp;the&nbsp;position&nbsp;of&nbsp;&nbsp;Pan-Zoom&nbsp;control&nbsp;which&nbsp;is&nbsp;always&nbsp;in&nbsp;left&nbsp;side.&nbsp;

I&nbsp;want&nbsp;to&nbsp;place&nbsp;this&nbsp;control&nbsp;in&nbsp;bottom&nbsp;side&nbsp;of&nbsp;map.&nbsp;Is&nbsp;this&nbsp;possible?

Thanks

Sunil

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [December 26, 2011, 10:40am UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/4 "2011-12-26T10:40:39Z")

</div>

Sunil,

&nbsp;&nbsp;I&nbsp;could&nbsp;figure&nbsp;out&nbsp;how&nbsp;to&nbsp;set&nbsp;the&nbsp;navigation&nbsp;panel&nbsp;to&nbsp;the&nbsp;right&nbsp;as&nbsp;you&nbsp;can&nbsp;see&nbsp;in&nbsp;the&nbsp;screen&nbsp;shot&nbsp;with&nbsp;the&nbsp;following&nbsp;code:

Map1.MapTools.PanZoomBar.FlowDirection&nbsp;=&nbsp;System.Windows.FlowDirection.RightToLeft;

But&nbsp;for&nbsp;putting&nbsp;it&nbsp;to&nbsp;the&nbsp;bottom,&nbsp;I&nbsp;will&nbsp;have&nbsp;to&nbsp;ask&nbsp;to&nbsp;the&nbsp;Wpf&nbsp;team.&nbsp;Tomorrow&nbsp;you&nbsp;should&nbsp;have&nbsp;the&nbsp;complete&nbsp;solution.&nbsp;Thank&nbsp;you.

 ![](https://community.thinkgeo.com/uploads/default/original/2X/7/71ede29801a4cc7c66cecfd83ecb95959a2189be.jpg)

---

<div class="post-metadata">

**Author:** ![Howard](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/90ced4/32.png) [@Howard](https://community.thinkgeo.com/u/Howard)\
**Post date:** [December 27, 2011, 12:02am UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/5 "2011-12-27T00:02:50Z")

</div>

Hi&nbsp;Sunil,

The&nbsp;PanZoomBar&nbsp;is&nbsp;actually&nbsp;a&nbsp;control;&nbsp;we&nbsp;can&nbsp;modify&nbsp;its&nbsp;position&nbsp;as&nbsp;we&nbsp;wanted.&nbsp;Here&nbsp;is&nbsp;a&nbsp;way&nbsp;to&nbsp;make&nbsp;it&nbsp;horizontal&nbsp;orientation.&nbsp;  
  
1,&nbsp;hook&nbsp;a&nbsp;SizeChanged&nbsp;event&nbsp;on&nbsp;the&nbsp;container&nbsp;of&nbsp;the&nbsp;map.&nbsp;For&nbsp;example,&nbsp;in&nbsp;our&nbsp;installed&nbsp;sample&nbsp;"DisplayASimpleMap",&nbsp;map's&nbsp;container&nbsp;is&nbsp;"LayoutRoot".  
  
SizeChanged="LayoutRoot\_SizeChanged"

2,&nbsp;in&nbsp;the&nbsp;event&nbsp;implemtation,&nbsp;here&nbsp;is&nbsp;the&nbsp;code:  
  
`private void LayoutRoot_SizeChanged(object sender, SizeChangedEventArgs e){    Canvas.SetTop(Map1.MapTools.PanZoomBar, e.NewSize.Height - 360);    Canvas.SetLeft(Map1.MapTools.PanZoomBar, e.NewSize.Width);    RotateTransform rotateTransform1 = new RotateTransform();    rotateTransform1.Angle = -90;    rotateTransform1.CenterX = 0;    rotateTransform1.CenterY = 360;    Map1.MapTools.PanZoomBar.RenderTransform = rotateTransform1;    var panPanel = (Canvas)((Grid)((Canvas)VisualTreeHelper.GetChild(Map1.MapTools.PanZoomBar, 0)).Children[0]).Children[0];    panPanel.RenderTransformOrigin = new Point(.5, .5);    RotateTransform rotateTransform2 = new RotateTransform();    rotateTransform2.Angle = -90;    panPanel.RenderTransform = rotateTransform2;}`

Here&nbsp;is&nbsp;the&nbsp;screenshot.

 ![](https://community.thinkgeo.com/uploads/default/original/2X/2/2eec25e2748f6d49f3b5c60980db9adb1303994e.jpg)

Please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;more&nbsp;queries.

Thanks,  
  
Howard

---

<div class="post-metadata">

**Author:** ![Chad3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/8baadc/32.png) [@Chad3](https://community.thinkgeo.com/u/Chad3)\
**Post date:** [September 11, 2013, 1:43pm UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/6 "2013-09-11T13:43:26Z")

</div>

I&nbsp;realize&nbsp;this&nbsp;is&nbsp;the&nbsp;Silverlight&nbsp;board,&nbsp;but&nbsp;I’m&nbsp;assuming&nbsp;the&nbsp;concept&nbsp;is&nbsp;similar&nbsp;in&nbsp;WPF.&nbsp;&nbsp;I&nbsp;would&nbsp;like&nbsp;to&nbsp;just&nbsp;shift&nbsp;the&nbsp;pan&nbsp;zoom&nbsp;bar&nbsp;to&nbsp;the&nbsp;right&nbsp;slightly.  
  
  
  
I’m&nbsp;trying&nbsp;to&nbsp;use&nbsp;this&nbsp;code&nbsp;in&nbsp;the&nbsp;map&nbsp;container’s&nbsp;sizechanged&nbsp;event&nbsp;and&nbsp;it&nbsp;has&nbsp;no&nbsp;affect&nbsp;on&nbsp;the&nbsp;position:

> `Canvas.SetLeft(Map1.MapTools.PanZoomBar, 80)`

---

<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:** [September 11, 2013, 9:38pm UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/7 "2013-09-11T21:38:40Z")

</div>

Hi&nbsp;Chad,

Welcome&nbsp;to&nbsp;MapSuite&nbsp;World,&nbsp;I&nbsp;have&nbsp;tried&nbsp;to&nbsp;recreate&nbsp;the&nbsp;problem&nbsp;but&nbsp;it&nbsp;didn't&nbsp;show&nbsp;up,&nbsp;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?&nbsp;followingis&nbsp;a&nbsp;result&nbsp;image&nbsp;on&nbsp;our&nbsp;end.

 ![](https://community.thinkgeo.com/uploads/default/original/2X/2/20bb495980a54feac5a10c9cd3779fc3bcfac392.PNG)

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

Summer

[Post9922.txt](https://community.thinkgeo.com/uploads/default/original/2X/d/dd67cfb9007482828630d72ea10c57ccbdb3c049.txt) (1.96 KB)

---

<div class="post-metadata">

**Author:** ![Chad3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/8baadc/32.png) [@Chad3](https://community.thinkgeo.com/u/Chad3)\
**Post date:** [September 12, 2013, 10:50am UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/8 "2013-09-12T10:50:44Z")

</div>

Hi&nbsp;Summer,  
  
  
  
I&nbsp;guess&nbsp;the&nbsp;difference&nbsp;is&nbsp;I’m&nbsp;trying&nbsp;to&nbsp;accomplish&nbsp;the&nbsp;same&nbsp;thing&nbsp;in&nbsp;WPF.&nbsp;&nbsp;I&nbsp;figured&nbsp;Silverlight&nbsp;handles&nbsp;layouts&nbsp;and&nbsp;rendering&nbsp;the&nbsp;same&nbsp;way&nbsp;as&nbsp;WPF,&nbsp;but&nbsp;maybe&nbsp;not.&nbsp;&nbsp;I’m&nbsp;pretty&nbsp;new&nbsp;to&nbsp;WPF.&nbsp;&nbsp;This&nbsp;is&nbsp;my&nbsp;XAML,&nbsp;which&nbsp;I’m&nbsp;just&nbsp;trying&nbsp;to&nbsp;tweak&nbsp;the&nbsp;DisplayAMapSample.xaml&nbsp;in&nbsp;the&nbsp;VB&nbsp;2010&nbsp;ThinkGeo&nbsp;WPF&nbsp;sample&nbsp;project.&nbsp;&nbsp;I’ve&nbsp;tried&nbsp;handling&nbsp;the&nbsp;SizeChanged&nbsp;in&nbsp;both&nbsp;grid&nbsp;containers&nbsp;to&nbsp;no&nbsp;avail.&nbsp;&nbsp;Thanks,  
  
  
  
Chad

> `<``Grid`&nbsp;`SizeChanged``=``"Grid_SizeChanged"``>`  
> `       ``<``Grid`&nbsp;`SizeChanged``=``"Grid_SizeChanged_1"``>`  
> `           ``<``uc1:WpfMap`&nbsp;`x:Name``=``"Map1"`&nbsp;`Loaded``=``"WpfMap_Loaded"``></``uc1:WpfMap``>`  
> `           ``<``uc2:InstructionPanel`&nbsp;`Width``=``"200"`&nbsp;`HorizontalAlignment``=``"Right"`&nbsp;`VerticalAlignment``=``"Top"`&nbsp;`Margin``=``"8"`&nbsp;`Opacity``=``"0.95"``>`  
> `               ``<``StackPanel``>`  
> `                   ``<``TextBlock`&nbsp;`x:Name``=``"InstructionLabel"`&nbsp;`Text``=``"This sample shows how to display a simple map."`&nbsp;`TextWrapping``=``"Wrap"`&nbsp;`/>`  
> `               ``</``StackPanel``>`  
> `           ``</``uc2:InstructionPanel``>`  
> `       ``</``Grid``>`  
> `   ``</``Grid``>`

---

<div class="post-metadata">

**Author:** ![Chad3](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/8baadc/32.png) [@Chad3](https://community.thinkgeo.com/u/Chad3)\
**Post date:** [September 12, 2013, 11:03am UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/9 "2013-09-12T11:03:03Z")

</div>

I&nbsp;just&nbsp;discovered&nbsp;I&nbsp;can&nbsp;modify&nbsp;the&nbsp;Margin&nbsp;property&nbsp;of&nbsp;the&nbsp;panzoombar&nbsp;at&nbsp;run&nbsp;time.&nbsp;&nbsp;This&nbsp;allow&nbsp;me&nbsp;to&nbsp;slide&nbsp;it&nbsp;where&nbsp;I&nbsp;need&nbsp;it.  
  
  
  
Chad

---

<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:** [September 12, 2013, 8:28pm UTC](https://community.thinkgeo.com/t/need-to-rotae-map-panzoombar-control/6982/10 "2013-09-12T20:28:57Z")

</div>

Hi&nbsp;Chad,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Great&nbsp;to&nbsp;hear&nbsp;it&nbsp;is&nbsp;sorted&nbsp;out,&nbsp;and&nbsp;if&nbsp;you&nbsp;have&nbsp;any&nbsp;more&nbsp;question,&nbsp;please&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;us&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Best&nbsp;Regards&nbsp;  
&nbsp;&nbsp;  
&nbsp;Summer
