Click here to Skip to main content
15,886,724 members
Articles / Web Development / HTML

Using Bing Maps for Windows 8 Metro Apps - C# / JavaScript

Rate me:
Please Sign up or sign in to vote.
4.97/5 (42 votes)
8 May 2013CPOL8 min read 151.6K   5.3K   69  
Building Windows 8 Metro applications using Bing Maps control.
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>BingMapsDemo_JS</title>

    <!-- WinJS references -->
    <link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet" />
    <script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
    <script src="//Microsoft.WinJS.1.0.RC/js/ui.js"></script>

    <script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapicore.js"></script>
    <script type="text/javascript" src="ms-appx:///Bing.Maps.JavaScript//js/veapiModules.js"></script>

    <!-- BingMapsDemo_JS references -->
    <link href="/css/default.css" rel="stylesheet" />
    <script src="/js/default.js"></script>
</head>
<body>
    <div id="mapdiv"></div>

    <div id="appbar" data-win-control="WinJS.UI.AppBar">
        <button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'changeMapType', label:'Map Type', icon:'&#xE12B;',section:'global',tooltip:'New'}"></button>
        <button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'setLocation', label:'Set Location', icon:'&#xE128;',section:'global',tooltip:'Set Location'}"></button>
        <button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'addLayer', label:'Add Layer', icon:'&#xE1E4;',section:'global',tooltip:'Add Layer'}"></button>
        <button data-win-control="WinJS.UI.AppBarCommand" data-win-options="{id:'cleanMap', label:'Clear Tiles', icon:'&#xE0E0;',section:'global',tooltip:'Clear Tiles'}"></button>

        
    </div>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Sela
Israel Israel
Shai Raiten is VS ALM MVP, currently working for Sela Group as a ALM senior consultant and trainer specializes in Microsoft technologies especially Team System and .NET technology. He is currently consulting in various enterprises in Israel, planning and analysis Load and performance problems using Team System, building Team System customizations and adjusts ALM processes for enterprises. Shai is known as one of the top Team System experts in Israel. He conducts lectures and workshops for developers\QA and enterprises who want to specialize in Team System.

My Blog: http://blogs.microsoft.co.il/blogs/shair/

Comments and Discussions