Step 1. Create a HTML or .Net page, let’s call it Sample_1
Step 2. Within the HEAD section, enter the below JavaScript line.
<script type="text/javascript" src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1"></script> <script type="text/javascript"> var map = null; function GetMap() { map = new VEMap('myMap'); map.LoadMap(); } </script>
Let’s talk about these lines for a minute. First, the script tag uses “src” which is source of the JavaScript which is hosted by Microsoft so we do not have to have this file in our folder. Second, notice the second set of “script” tag attributes. This is where we have the function which will load the MS Virtual Earth Map within our page.
Step 3. Modify the BODY tag of your HTML page to match this,
<body onload="GetMap();"> We modified the body tag so the page will call the GetMap() function when the page first loads.
Step 4. Now let’s add a place holder for Microsoft Map. Add the following code within the opening and closing of the BODY tag
<div id='myMap' style="position:relative; width:400px; height:400px;"></div> Notice we have id=”myMap”. This is used by Step 2 above and our code in Step 3 which will load Microsoft Map here. It’s basically used as a map placeholder.
That is all, now you have a page that will show Google Maps using the API, offered by Microsoft Virtual Earth for free. See the screen shot of this example so far. (Example_1.jpg)