---
title: "Map Control in Windows 7 Phone Development"  
description: "The Bing Maps Silverlight Control for Windows Phone allows developers to provide an enhanced mapping experience within their Windows Phone application"  
author: "Anonymous User"  
published: 2012-04-12  
updated: 2019-11-13  
canonical: https://www.mindstick.com/articles/918/map-control-in-windows-7-phone-development  
category: "windows phone"  
tags: ["windows phone"]  
reading_time: 2 minutes  

---

# Map Control in Windows 7 Phone Development

The Bing Maps [Silverlight](https://www.mindstick.com/blog/54/silverlight-in-asp-dot-net) Control for Windows Phone allows [developers](https://yourviews.mindstick.com/view/88480/why-developers-combine-multiple-ai-tools-instead-of-one) to provide an enhanced mapping [experience](https://www.mindstick.com/articles/12957/best-tips-to-make-your-ghostwriting-experience-a-success) within their Windows Phone [applications](https://www.mindstick.com/articles/12847/how-to-choose-the-right-ethernet-cable-for-industrial-applications) to end users. This article is going to explain how to use Bing Map control in windows 7 phone development or Windows 7 phone application. Let’s see a brief demonstration on it.\

Getting started:

1. Open [Visual Studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available)

2. Create new Silverlight Windows 7 Phone [Development Project](https://www.mindstick.com/blog/11637/how-to-choose-the-right-web-designer-for-your-web-design-development-project)

3. Enter [your project](https://www.mindstick.com/forum/156583/best-way-to-link-bootstrap-file-in-your-project) Name

4. Click on button ‘Ok’

![Map Control in Windows 7 Phone Development](https://www.mindstick.com/mindstickarticle/68ca4c95-2ab6-4df0-94fa-9b340ca80d4a/images/eaff565a-4339-4d80-b0bc-c25a97225517.png)

Now drag and drop Map control form toolbox into MainPage.xaml design page and write down the following code:

![Map Control in Windows 7 Phone Development](https://www.mindstick.com/mindstickarticle/68ca4c95-2ab6-4df0-94fa-9b340ca80d4a/images/ecea63c9-5464-418f-a9f7-49ccfbbfd9fe.png)

##### Code of ‘MainPage.xaml’ file:

```
<!--LayoutRoot
is the root grid where all page content is placed-->    <Grid x:Name="LayoutRoot" Background="#FF2D747A">        <Grid.RowDefinitions>            <RowDefinition Height="Auto"/>            <RowDefinition Height="*"/>        </Grid.RowDefinitions>         <!--TitlePanel contains
the name of the application and page title-->        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">            <TextBlock x:Name="ApplicationTitle" Text="My Application" Style="{StaticResource PhoneTextNormalStyle}"/>            <TextBlock x:Name="PageTitle" Text="Map Demo" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>        </StackPanel>         <!--ContentPanel - place
additional content here-->        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">            <my:Map Height="338" HorizontalAlignment="Left" Margin="34,30,0,0" Name="mapDemo" VerticalAlignment="Top" Width="380" Background="#FF47E8C3" />            <Button Content="Road Mode" Height="96" HorizontalAlignment="Left" Margin="16,414,0,0" Name="btnRoad" VerticalAlignment="Top" Width="206" Click="btnRoad_Click" Background="#FF7C4B5E" />            <Button Content="Aerial Mode" Height="96" HorizontalAlignment="Left" Margin="226,416,0,0" Name="btnAerial" VerticalAlignment="Top" Width="202" Background="#FF7C4B5E" Click="btnAerial_Click"
/>            <Button Content="Zoom In" Height="97" HorizontalAlignment="Left" Margin="12,510,0,0" Name="btnZoomIn" VerticalAlignment="Top" Width="206" Click="btnZoomIn_Click" Background="#FF7C4B5E" />            <Button Content="Zoom Out" Height="95" HorizontalAlignment="Left" Margin="226,512,0,0" Name="btnZoomOut" VerticalAlignment="Top" Width="202" Click="btnZoomOut_Click" Background="#FF7C4B5E" />        </Grid>    </Grid>
```

##### \

##### Code of ‘MainPage.xaml.cs’ file:

```
using System.Windows;using Microsoft.Phone.Controls;using Microsoft.Phone.Controls.Maps; namespace MapDemo{    public partial class MainPage : PhoneApplicationPage    {        // Constructor        public MainPage()        {            InitializeComponent();        }         private void btnRoad_Click(objectsender, RoutedEventArgse)        {            mapDemo.Mode=new RoadMode();        }         private void btnAerial_Click(objectsender, RoutedEventArgse)        {            mapDemo.Mode=new AerialMode();        }         private void btnZoomIn_Click(objectsender, RoutedEventArgse)        {            mapDemo.ZoomLevel+=1;        }         private void btnZoomOut_Click(objectsender, RoutedEventArgse)        {            mapDemo.ZoomLevel-=1;        }     }}
```

Now execute [your application](https://answers.mindstick.com/qa/95487/how-do-you-troubleshoot-when-your-application-link-is-not-responding) then following output will be appearing;

\
\

![Map Control in Windows 7 Phone Development](https://www.mindstick.com/mindstickarticle/68ca4c95-2ab6-4df0-94fa-9b340ca80d4a/images/905b0aeb-0cef-49d9-a3c2-8234344e0225.png)

Now just click on button ‘Aerial Mode’ to see map in aerial mode.

![Map Control in Windows 7 Phone Development](https://www.mindstick.com/mindstickarticle/68ca4c95-2ab6-4df0-94fa-9b340ca80d4a/images/ddfdce5d-c683-4a01-901e-816db1f1b92e.png)

To maximize or minimize the map; just click on the button ‘Zoom In’ or ‘Zoom Out’;

![Map Control in Windows 7 Phone Development](https://www.mindstick.com/mindstickarticle/68ca4c95-2ab6-4df0-94fa-9b340ca80d4a/images/15215ad6-41db-4684-b170-b900d1620243.png)

This is the complete description of Map Control in Windows 7 Phone development. I hope you will enjoy it. Thanks for reading this article.

\

---

Original Source: https://www.mindstick.com/articles/918/map-control-in-windows-7-phone-development

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
