VEMap.ClearInfoBoxStyles 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.

Clears out all of the default Bing Maps info box CSS styles.


This method internally clears out the default info box styles used to give the Bing Maps default info box its look and feel. You are left with a few basic style components to get you started. You can then reference your own CSS classes from within your custom HTML content for your ERO to style your info box as you wish.

The default style sheets that remain after this method is called are listed here:

/* Styles that apply to the info box's containing element whether it has no beak, a rightBeak, or a leftBeak */ 

            position: absolute;

/* Offset the body for the drop-shadow and set the body background and border just for starters (developers can change this easily)*/

            position: relative;
            top: -5px;
            left: -5px;
            padding: 8px;
            border: 1px solid #000;
            background-color: #fff;

/* Apply a nice default drop-shadow after the default Bing Maps info box styles are cleared */ 

            position: relative;
            background-color: #ccc;

/* Sections of the info box that a developer could style if desired, but have no style when the default Bing Maps info box styles are cleared */ 


/* Sections of the info box that should not be visible when the default Bing Maps info box styles are cleared */ 

            display: none;

            visibility: hidden;

<!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 = null;
         function GetMap()
            map = new VEMap('myMap');

         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()
         function SetInfoBoxStyles()
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:400px; 
      <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()" />