Bing Maps with JavaScript and Windows 8

I was having some trouble finding any good information on how to implement the final build of Bing Maps (v1.1.20120927.0) into a WinJS Windows Store application. ┬áIt’s actually pretty simple.

Start by downloading and installing the Bing Maps SDK from:

In Solution Explorer, right click on References and add a reference to “Bing Maps for JavaScript”

Add the following script tag to the top of your HTML file:

And add a DIV tag to the HTML which will contain the map:

Now add the following JavaScript code to your JavaScript file:

Add this JavaScript to your onactivated or ready events in the JavaScript file: