Bing Map 7 Functions Java Script RRS feed

  • Question

  • How to call functions of Bing Map 7 from a seperate Java script File. 

    //Call function from Map.js 


    ***Map.js ***** 
    //GetMap function in Map.js

     BloodDonors.GetMap =function () {  
     BloodDonors._map = new Microsoft.Maps.Map( credentials: "Your Bing Maps Key" ...);  

    I am working on Bing Maps.  The Project has been completed using Map ver 6.3, source code here http://code.msdn.microsoft.com/ASPNET-MVC-4-with-Bing-Maps-947ae78c 

    Now, want to convert it to ver 7 Maps. I want a separate file for JavaScript functions. How to call Bing Map API 7 functions from CSHTML file. Following is the idea that is not working.

    Monday, May 28, 2012 5:21 AM


  • Looking at the source code to this project it looks like migrating this over to V7 should be fairly easy. The main difference in the API's is the syntax. for th e most part the API's work very similarly.

    Looking at the source code of the project I didn't see a GetMap function, only a loadmap function. Here is a v7 version of the LoadMap function:

    BloodDonors.LoadMap = function (latitude, longitude, onMapLoaded) {
        BloodDonors._map = new Microsoft.Maps.Map(document.getElementById(BloodDonors.MapDivId), {
    		disableBirdseye : true,
    		center : new Microsoft.Maps.Location(latitude, longitude)
    Note that there are a number of different options for rendering the navigation controls. In the code above I've just let the default controls load.


    Monday, May 28, 2012 8:16 AM