Using the Silverlight Map Control on Windows Phone 7
A version of the Bing Maps Silverlight Control is available for Windows Phone 7 which allows developers to make the enhanced mapping experience of Silverlight available to Windows Phone users. This topic includes information to get started using the Windows Phone version of the Bing Maps Silverlight Control.
The following steps will get you started developing your Bing Maps Silverlight Control application for Windows Phone.
Download the Windows Phone Developer Tools from App Hub. This download includes the Microsoft.Phone.Controls.Maps.dll, which contains the API for the Bing Maps Silverlight Control for Windows Phone. You also need to install the Windows Phone Developer Tools October 2010 Update from the Microsoft Download Center.
Get familiar with the Bing Maps Silverlight Control using the Bing Maps Silverlight Control Interactive SDK and topics in the Developing with the Silverlight Map Control sections of this SDK. In addition, the Bing Maps Silverlight Control for Windows Phone Class Library as well as help with Windows Phone development is found in the Windows Phone Development section on MSDN. Silverlight features supported on Windows Phone are described in the Features Supported in Silverlight on Windows Phone topic.
To authenticate your Bing Maps Silverlight Control application, you need a Bing Maps Key. Sign in to the Bing Maps Account Center to obtain a Bing Maps Key. This is described in the Getting a Bing Maps Key topic.
Develop a basic Windows Phone map application using the steps in the How to: Use the Bing Maps Silverlight Control for Windows Phone topic. Use your Bing Maps Key to authenticate your application as described in Accessing the Control Using a Bing Maps Key.
Bing Maps Silverlight Control for Windows Phone
Use the Windows Phone Class Library Reference for information about the types and members of the Bing Maps Silverlight Control for Windows Phone. The Bing Maps Silverlight Control for Windows Phone API is very similar to the desktop version of the API. However, in order to facilitate Windows Phone development, some changes were made to the Windows Phone version of the Bing Maps Silverlight Control.
|The namespace names of the Bing Maps Silverlight Control for Windows Phone are different than the names of the desktop version of the control. The Windows Phone map control has the following namespaces: Microsoft.Phone.Controls.Maps, Microsoft.Phone.Controls.Maps.AutomationPeers, Microsoft.Phone.Controls.Maps.Core, Microsoft.Phone.Controls.Maps.Design, Microsoft.Phone.Controls.Maps.Overlays, and Microsoft.Phone.Controls.Maps.Platform.|
Other major changes include:
Wherever a Location object is found in the desktop map control API, a System.Device.Location.GeoCoordinate type needs to be used in the Windows Phone map control. Note that GeoCoordinate has a range limit on Latitude and Longitude and if you don’t specify a value, it defaults to NaN. Location.Latitude and Longitude defaults to 0 and has no checks for Latitude and Longitude.
To support flick and touch actions, the Windows Phone map control API has new event argument classes: MapDragEventArgs and MapFlickEventArgs. In addition, the MapPan, MapResolved, and MapZoom events have been added to the MapBase and MapCore classes, as well as new MapMode members OnMapDrag, OnMapFlick, and OnMapZoom.