×
Namespaces

Variants
Actions
(Difference between revisions)

Real-time rotation of the Windows Phone 8 Map Control

From Nokia Developer Wiki
Jump to: navigation, search
ltuska (Talk | contribs)
m (Ltuska - - References)
ltuska (Talk | contribs)
m (Ltuska - - References)
Line 37: Line 37:
  
 
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff426933(v=vs.105).aspx How to handle manipulation events for Windows Phone]
 
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff426933(v=vs.105).aspx How to handle manipulation events for Windows Phone]
 +
 +
[https://www.microsoftvirtualacademy.com/tracks/building-apps-for-windows-phone-8-jump-start Building Apps for Windows Phone 8 Jump Start]
  
 
[http://channel9.msdn.com/posts/Building-Apps-for-Windows-Phone-8-Jump-Start-14-Maps-and-Location-in-Windows-Phone-8 Building Apps for Windows Phone 8 Jump Start-Maps and Location in Windows Phone 8]
 
[http://channel9.msdn.com/posts/Building-Apps-for-Windows-Phone-8-Jump-Start-14-Maps-and-Location-in-Windows-Phone-8 Building Apps for Windows Phone 8 Jump Start-Maps and Location in Windows Phone 8]
 +
 +
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967560(v=vs.105).aspx App performance considerations for Windows Phone]
  
 
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.maps.controls.map(v=vs.105).aspx Windows Phone 8 Maps Control API]
 
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.phone.maps.controls.map(v=vs.105).aspx Windows Phone 8 Maps Control API]
  
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.input.touch(v=vs.105).aspx Touch]
+
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.input.touch(v=vs.105).aspx Touch class]
  
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.input.touch.framereported(v=vs.105).aspx FrameReported]
+
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/system.windows.input.touch.framereported(v=vs.105).aspx FrameReported event]
 
+
[http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967560(v=vs.105).aspx App performance considerations for Windows Phone]  
+
  
 
{{ArticleMetaData <!-- v1.2 -->
 
{{ArticleMetaData <!-- v1.2 -->

Revision as of 13:44, 9 December 2012


This article explains how to rotate the Windows Phone 8 Map Control object real-time. The provided solution uses the Touch class to react on FrameReported events. It also shows a relatively simple way to test multi touch behavior using the Windows Phone 8 emulator.

Note.pngNote: This is an "internal" entry in the Windows Phone 8 Wiki Competition 2012Q4. The author is a Nokia / Microsoft employee.

Contents

Motivation

Windows Phone 8 comes with a new Maps framework, and provides extended functionality compared to the Windows Phone 7.1 Maps components. One of these new features is that the developer can set the "Heading" property of the Map control. This property is described on the Maps and navigation for Windows Phone 8 page as: This parameter specifies the directional heading that is pointing “up” on the map. It is represented in geometric degrees by a value that is between 0 and 360, indicating the number of degrees to rotate the map.

Preparation

New features in Windows Phone 8 Maps API

Here are just a few new features for the Location framework I found interesting:

  • Improved ability for one-shot location acquisition
  • Map control, Map tasks can make use of the downloaded offline maps (no data connection required)
  • Background task support for location tracking applications

Tip.pngTip: For a comprehensive introduction to the new capabilities of the Location API, watch this excellent video from channel 9.

Since these features are covered quite well in various tutorials in the internet, in this article I will concentrate only on the map view setting feature.

How to test multi touch in the emulator

But before we could start to work on our problem, we have to come over an obstacle: what if you (like me) doesn't have the hardware to test multi touch events on a real device. Luckily there is help on the internet. The Multi-Touch Vista project on codeplex provides a Windows service which emulates a touch screen, with multiple touch point (at least if you happen to have at least 2 pointing devices).

To install this service, follow the steps from the download page.

How the easy way should look like...

The solution

Conclusion

References

Windows Phone Multi-Touch Manipulation

How to handle manipulation events for Windows Phone

Building Apps for Windows Phone 8 Jump Start

Building Apps for Windows Phone 8 Jump Start-Maps and Location in Windows Phone 8

App performance considerations for Windows Phone

Windows Phone 8 Maps Control API

Touch class

FrameReported event

SignpostIcon HereMaps 99.png
SignpostIcon XAML 40.png
WP Metro Icon WP8.png
Article Metadata
Compatibility
Platform(s): Windows Phone 8
Windows Phone 8
Article
Keywords: manipulation touch map control
Created: ltuska (09 Dec 2012)
Last edited: ltuska (09 Dec 2012)
551 page views in the last 30 days.
×