This project is read-only.

Once you find the module you are interested in downloading be sure to check to see if it relies on any other plugins. Most, if not all modules should include both a sample of how to implement the module and documentation.

Adding a module to your web project

  1. Copy over the JavaScript file that contains the module to your project. Take note of any external resources it may use such as images or CSS style sheets. Copy over any external resources as needed, be sure to maintain the same folder hierarchy.
  2. Register the module being sure that the URL provided when registering points to where the JavaScript module is located in your web project.
  3. Load the module and include any necessary callback functionality. Often the callback function is where the module will be used for the first time.

Example of how to load in a plugin

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <script type="text/javascript" src=""></script>

      <script type="text/javascript">
         var map;

         function myModuleLoaded()
            //call code that uses your module.

         function GetMap()
             // Initialize the map
             var options = {credentials: "Bing Maps Key"};
             map = new Microsoft.Maps.Map(document.getElementById('mapDiv'), options);

             // Register and load the arrow module
             Microsoft.Maps.registerModule("MyModule", "");
             Microsoft.Maps.loadModule("MyModule", { callback: myModuleLoaded });
   <body onload="GetMap();">
      <div id='mapDiv' style="position:relative;width:400px;height:400px;"></div>       

Last edited Aug 18, 2011 at 5:54 PM by rbrundritt, version 4


No comments yet.