1
votes

In my windows phone app I have a map object which points to the position longitude and latitude. I track the position changed event for every few meters threshold value. It works fine and shows the data correctly on map with puhpins when I am moving from point A to point B.

But when I am moving from point B to point A, it shows the map in the same direction as earlier which is A to B with pushpin values moving from B to A.

I want to change this behavior that is when a person is moving from point B to A the B point should face the person holding the mobile and pushpins should move towards A i.e. away from the person who is holding the phone.. currently I rotate my mobile 180 degress to see the pushpins are pointing towards A from B.

2
please share what you are doing and what you have tried. Don't just describe the problem or all we can do is guess what the issue actually is. - Matt Lacey

2 Answers

2
votes

Bing Maps doesn't support rotating PushPins or perspective on WP7/WP8. You can only rotate the full Bing Maps control. Which causes a lot of problems if you have unidirectional items (such as text) as they'll show up rotated alongside with the map.

If you're on WP8, you can use the new Nokia Map control and set the Pitch & Heading properties to rotate the map for turn-by-turn navigation. See examples of setting Pitch, Heading and other properties at this Nokia article @ http://www.developer.nokia.com/Resources/Library/Lumia/#!maps-tutorial.html;#toc_Mapproperties

For example, here's the WP8 Map control with Heading=0:

WP8 Map control with Heading=0:

And here is the same place rotated with all the text and items appearing as they should with Heading=180.

Heading=180

And here's the Map control after setting the Pitch property. Map control after setting the Pitch property

The reason Bing Maps can't do rotations and Pitch correctly is because it has Bitmap tiles. Which means the data it gets from the server is an bunch of images it lays out in a grid. The reason Nokia Maps can do rotations and pitch correctly is because it uses vector tiles. It gets data from the server about what's in each location and the map control itself draws the topographic layout.

1
votes

This code worked for me- http://j2i.net/blogEngine/post/2010/12/15/Calculating-Distance-from-GPS-Coordinates.aspx You should save the last coordinate (or get the next one you are heading to) and compare them using the Bearing method, then set myMap.Heading property to the received value.