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

Shows all of the VEShapeLayer Class objects on the map.

VEMap.ShowAllShapeLayers();

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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="https://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();

            map.HideDashboard();

            // Create some shape layers
            for (var i = 1; i < 4; i++)
            {
               layer = "layer" + i;
               layer = new VEShapeLayer();
               layer.SetTitle("ShapeLayer" + i);
               layer.SetDescription("This is ShapeLayer " + i + ".");
               title = layer.GetTitle();
               map.AddShapeLayer(layer);
            }

            AddShapes();
         }  
            
         // Add a shape to each layer.
         function AddShapes()
         {
            var points = new Array(
               new VELatLong(45.01188,-111.06687),
               new VELatLong(45.01534,-104.06324),
               new VELatLong(41.01929,-104.06),
               new VELatLong(41.003,-111.05878)
            );
            
            for (var i = 0; i < 4; i++)
            {
               shape = new VEShape(VEShapeType.Pushpin, points[i]);
               layer = map.GetShapeLayerByIndex(i);
               shape.SetDescription("This is the pushpin for layer" + i + ".");
               shape.SetTitle("Layer " + i);
               layer.AddShape(shape);
            }

            map.SetMapView(points);
         }
        
         function HideAllLayers()
         {
            map.HideAllShapeLayers();
         }
        
         function ShowAllLayers()
         {
            map.ShowAllShapeLayers();
         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
      <a href="#" onclick="HideAllLayers()">Hide All Shape Layers</a><br />
      <a href="#" onclick="ShowAllLayers()">Show All Shape Layers</a>
   </body>
</html>

See Also

Reference

VEMap.HideAllShapeLayers Method