1

I have a Windows Phone application with a map. On this map, there are several pushpins (different infos on the map) and a pushpin of the current position. I want to show the heading direction (the direction the user looks with his phone) on the current position pushpin (using the compass angle). I already have a custom control that rotates according to the compass value. What I don't know is how to incorporate it into the map, i.e. show it on the current position on the map.

Do you have any ideas?

Thank you very much.

PS: If you don't know what I mean, I intend to do something like it's available in the (Nokia) Here Maps Here Maps heading direction with compass.

2
  • Most Windows Phone 7 devices don't have a compass, it wasn't a required part of the platform. All WP8 devices do have it though. Commented Aug 4, 2013 at 1:41
  • hi @NeilTurner Thank you for the hint - I am aware of this fact. We developed an Augmented Reality app which also doesn't work on a lot of WP7 devices because it misses the compass.
    – casaout
    Commented Aug 4, 2013 at 7:14

1 Answer 1

2

I don't have a complete answer. What I know is you can add any control to a map using this technique:

myMap.Layers.Add(new MapLayer()
 {    
    new MapOverlay()
    {
        GeoCoordinate = new GeoCoordinate(37.795032,-122.394927),
        Content = new Ellipse
        {
            Fill = new SolidColorBrush(Colors.Red),
            Width = 40,
            Height = 40
        }
    }});

This comes from http://developer.nokia.com/Community/Wiki/What's_new_in_Windows_Phone_8

Now this will display a simple red dot, but I understand you can put just about any control in there. Use your control, bind the rotation to a value that will hold the rotation in your view model and I think you are quite done. Does this work for you?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.