Using Bing maps inside your app might be very important and amazing feature that rates up your app in the store so, let’s know how to add Bing Maps to your Windows Store App.
First of all you will need to install “Bing Maps for windows Store C#” from the following URL:
Then, Go to this website and register to get a Bing Maps Key (You will need it inside your App each time you use bing maps)
Then, follow the steps to register,
and when you register successfully, Navigate to this URL:
Create a new Key
Now, Open Visual Studio and follow these steps:
Now, you have to reference the Bing Maps SDK:
- In Visual Studio, select PROJECT > Add Reference
- Expand Windows, and then select Extensions.
- Select Bing Maps for C#, C++, or Visual Basic, and then click OK. (as shown)
- Then go to the Package.appmanifest, in Capabilities select Location (as shown)
Now, We will Insert a map into the app….
- Open MainPage.xaml in your project.
- Add the following namespace declaration in the Page tag.
- Insert the following XAML inside the <Grid> tags, and replace the placeholder INSERT_YOUR_BING_MAPS_KEY with your Bing Maps Key.
Now, we’ve already added the bing maps to the app Run and you will find the worldwide map.
Now let’s Add A Pushpin to the Map:
- In the MainPage.xaml, Add the following code:
and by the way you can change the Longitude and Latitude as you like, i just have specified it to my town “Kafr Ash Shaykh, Egypt” but, you can search for the Longitude and Latitude you want and add them to the Xaml code. 🙂
- In MainPage.xaml.cs, Add the following Code:
Now, Run the App and Click on the Pushpin. 🙂
Now, we have finished our tutorial.
and here’s the link of the Code Sample:
Soon there will be an Arabic recorded video for this tutorial.
And if you need any help or support, don’t hesitate to contact me 🙂