VEMap.SetDefaultInfoBoxStyles Method

You are not viewing the latest version of the AJAX control. Bing Maps AJAX V7 is the recommended JavaScript control for Bing Maps. If you need this documentation, it is available in as a CHM or PDF download.

Sets the info box CSS styles back to their original classes.


VEMap.SetDefaultInfoBoxStyles();

The VEMap.SetDefaultInfoBoxStyles method, called after a call to VEMap.ClearInfoBoxStyles Method, resets all of the original info box styles. The method VEMap.ClearInfoBoxStyles clears out all of the default info box styles and sets just a few basic styles.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title></title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

      <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3"></script>

      <script type="text/javascript">
         var map = null;
         
         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap();

            AddPin();
         }   
         
         function AddPin()
         {  
            var center = map.GetCenter();
            var pin = map.AddPushpin(center);
            pin.SetTitle("This is the title text");
            pin.SetDescription("This is the description text.");
         }

         function ClearInfoBoxStyles()
         {
            map.ClearInfoBoxStyles();
         }
        
         function SetInfoBoxStyles()
         {
            map.SetInfoBoxStyles();
         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:400px; 
         height:400px;"></div>
      <input id="clearinfoboxstyles" type="button" 
         value="Clear default info box styles" name="clearinfoboxstyles" 
         onclick="ClearInfoBoxStyles()" />
      <input id="setinfoboxstyles" type="button" 
         value="Set default info box styles" name="setinfoboxstyles" 
         onclick="SetInfoBoxStyles()" />
   </body>
</html>

Show: