HTML and CSS Reference
In-Depth Information
FIGURE 12-18 Getting the key to use the Bing SDK.
Make sure you note the key, because you will need it to use the Bing SDK in your applications.
latLongApp.BingKey = "...";
You need to initialize the Bing library before using it. That's something you might want to do in the
application's init method. Add the following code to the latLongApp.init method:
latLongApp.init = function () {
Microsoft.Maps.loadModule('Microsoft.Maps.Map', { culture: 'en-us' });
Now you're all set to display a map and retrieve address information.
Showing the location on a map
Windows Store applications written with JavaScript cannot rely on any built-in components to display
a map. However, you can add a DIV element to the page and then use the Bing SDK to render the
map within the boundaries of that DIV . Add the following code to default.html —position it as you
prefer—for example, just before the footer.
<div id="map" style="margin:2px;width:500px;height:400px; border:solid 2px #0ff;">
Search WWH ::

Custom Search