Reputation: 51
How would I go about integrating Bing Maps into a page or frame in my WPF application? I have found a lot of resources for Bing Maps development, but I don't need to develop with Bing Maps, just add the actual thing into my application without hyper-linking out to the website.
Windows 8 applications do this with "contracts" with other metro apps but I do not see a similar functionality with WPF applications.
Thank you!
Upvotes: 1
Views: 555
Reputation: 2096
Just go here and download the control :) http://msdn.microsoft.com/en-us/library/hh750210.aspx The control is in the "Bing Maps WPF Control SDK"
If i remember correctly you will need to register for an api key.
UPDATE: to get the api key you have to register here https://www.bingmapsportal.com/
Upvotes: 1
Reputation: 51
This was a lot easier than I expected, @Tjofras had a correct answer but here is some more elaboration:
1) Get a Bing Maps developer key for free here - https://www.bingmapsportal.com/ There is a trial version that gives you all the features, but for a limited time and there is a basic version that is free but has limited features.
2) Create a project in Visual Studio for Desktop
3) Check out this article for step-by-step instructions and the exact lines of code to integrate it into your project.
This line goes at the top of your MainWindow.xaml page :
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
Add the map into your existing grid with your developer key, initial latitude and longitude values, and an initial zoom level with the tags:
m:Map object
CredentialsProvider tag (your developer license code)
Center tag (initial latitude and longtitude)
ZoomLevel tag (how zoomed in you are)
Upvotes: 1