Tutorial for a Silverlight Bing Map Control
Silverlight Bing Map control can help you develop a map application. Silverlight is a development platform used for creating Web, desktop, and mobile applications for online or offline use. The Bing Map control can be used to incorporate the latest location and search features offered by Microsoft. Other features are available through this control, such as the Bird’s eye or Streetside maps.
Instructions
-
-
1
Launch Microsoft Visual Studio, then click the “New Project” link to launch the New Project window. Expand "Other Languages" below "Installed Templates." Expand "Visual C#" and click “Silverlight.” Double-click “Silverlight Application” to create a new project. Leave the default settings in the New Silverlight Application window and click “OK.”
-
2
Click the “Project” menu and click “Add Reference.” Click “Microsoft.Maps.MapControl.Common.dll” and “Microsoft.Maps.MapControl.dll” in the NET tab. Click “OK.”
-
-
3
Copy and paste the following code inside the “<UserControl>" tag to add the map control assembly to the “MainPage.xaml:”
xmlns:m="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl">
-
4
Add the following code to add the “<m:Map/>” element inside the “<Grid>” tag to create the map control:
<m:Map CredentialsProvider="your key" Mode="Aerial" Name="myMap" />
Replace “your key” with your Bing Maps Key. Press the “F5” key to run your project and view the map in Aerial mode.
-
1
References
Resources
- Photo Credit Comstock/Comstock/Getty Images