Share via


Bing Map Control in WPF

Introduction

*This article describes how to display bing map Control in WPF.
*

Building the Sample

It require Microsoft.Maps.MapControl.WPF.dll to display Bing Map Control in WPF.

Download Here

Description

After downloading you need to install it. You will find that library in program files just copy it and paste into bin folder of your project and add a reference to your project.

*If the control is not available in your toolbox choose items from WPF  Component.
*

It require namespace

 xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"

* For this purpose you need to create BING_MAP_KEY from this website.
*

*
*

*https://www.bingmapsportal.com/application
*

*
*

*There are two types of keys are available. Trial and Basic. The Trial Key expires after 90 days and cannot be converted into basic.
*

*Create your key and Add it into your XAML Code.
*

 <m:Map CredentialsProvider="YOUR_BING_MAP_KEY" x:Name="myMap" />

Use this namespace which is mentioned below.using Microsoft.Maps.MapControl.WPF;

Add the given code when application is initialise.

      myMap.Focus(); 
            //Set map to Aerial mode with labels 
            myMap.Mode = new AerialMode(true);

http://code.msdn.microsoft.com/vstudio/site/view/file/109199/1/bing%20map.JPG

*