locked
Having trouble with Bing Map API

    Question

  • Goal: Create a sample application for Windows 8 built on HTML5 & Javascript that uses the Bing Map API

    Attempt 1: Download and run the sample application here: http://code.msdn.microsoft.com/windowsapps/Bing-Maps-for-JavaScript-84f1effc 

    Problem: Visual Studio gets stuck loading the solution file.  "This project is still loading..."  When I try to close Visual Studio, a window appears that says: "The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Microsoft.VisualStudio..Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk."  I checked, and this file does not exist.  I have not found any information online related to this file missing.

    Attempt 2: Create a blank HTML5/Javascript app and copy over the relevant files from the sample application above.

    Problem: The javascript fails to load, giving me a "WinJS is undefined" error.

    Attempt 3: Fix the (maybe outdated?) sample code.  This consisted of me changing this

        <script type="text/javascript" src="//Microsoft.WinJS.0.6/js/base.js"></script>

    to this other format that I found in a different sample application

        <script type="text/javascript" src="/winjs/js/base.js"></script>

    Problem: I get a little further, but Bing maps are not loading properly, giving me a "Microsoft is undefined" error.  I copied the format for the script tag that loads Bing maps from the sample, and it is:

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

    I am brand new to Windows development and am unfamiliar with the tools, so maybe I'm doing something incorrectly.  I can't find any way to monitor network requests so I can't see where it's looking for this veapicore.js file.  I do not know what the ms-appx:// url is going to do (load it from a local file somewhere?)  I *have* downloaded the Bing maps SDK, though maybe it didn't install properly?  It would be helpful to hear of some way to double-check that.  I have made sure to run Windows Update recently, so Visual Studio (and the whole Win8 Dev Preview) should be up-to-date.  

    On a somewhat related note, I also tried building an application using Google Maps (based on the example here: http://dotupdate.wordpress.com/2011/10/29/using-maps-in-a-windows-8-metro-application/).  While the code did work, the map's performance was a bit choppy.  This is running on a desktop that was considered "fast" a couple years ago.  I am curious as to why that might be so, seeing as google maps isn't choppy at all when viewed in the Metro Internet Explorer.

    Tuesday, March 13, 2012 6:27 PM

Answers

All replies