Select to view content in your preferred language

Compass on Map for 10.2.7

09-03-2018 04:44 PM
New Contributor

Is it possible to add a compass to a map in a WPF application such that North South East and West can be displayed.

I notice version 100 supports this in the toolkit.

Is anything like this achievable with 10.2.7.

Kind Regards

Scott Brady

0 Kudos
2 Replies
Esri Notable Contributor

Technically the Compass control isn't "really" a compass in the direct sense, but more of a North Arrow for the map. Ie it shows the rotation of the map with an arrow in the direction of north.

So to do this in 10.2.7 all you need to do is bind the angle on a RotateTransform applied to an arrow to the MapView's rotation.

0 Kudos
New Contributor

I have added the following code and it does not appear to work.

<Border >
<Path Data="M15,0 30,40 18,40 18,400 12,400 12,40 0,40Z" Stroke="Black" Height="100"
Fill="Black" StrokeThickness="1" HorizontalAlignment="Center"
<RotateTransform Angle="{Binding Angle, ElementName=MyMapView.Rotation}" />

When rotating the map the arrow remains stationary and does not reflect the maps rotation and point north

0 Kudos