1: <script src="http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=5"> </script>
2: <script type="text/javascript">
3: var map = null;
4: // Loads the Virtual Earth map control
5: function GetMap()
6: {
7: map = new VEMap('myMap');
8: map.LoadMap(new VELatLong(0,0), 1,'r' ,false);
9: AddPins();
10: }
11: // Places a pushpin on the map using the parameters given, iconurl is ignored
12: function AddPin(lat, lon, iconurl, title, desc)
13: {
14: var shape =
15: new VEShape(VEShapeType.Pushpin,
16: new VELatLong(lat,lon));
17: shape.SetTitle(title);
18: shape.SetDescription(desc);
19: map.AddShape(shape);
20: }
21: // Programmatically adds func as a handler for the onload event
22: // This method has been used by many developers, but the code is
23: // via the ViaVirtualEarth Wiki
24: // http://www.viavirtualearth.com/Wiki/Load+VE+control+without+body+onload.ashx.
25: function addLoadEvent(func)
26: {
27: var oldonload = window.onload;
28: if (typeof window.onload != 'function')
29: { window.onload = func; }
30: else
31: { window.onload = function()
32: { oldonload(); func(); }
33: }
34: }
35: addLoadEvent(GetMap);
36: </script>
37: <div id='myMap' style="width:800px; height:600px;"></div>