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

Specifies whether shapes are drawn below a threshold zoom level.



Parameter Description


A Boolean value specifying whether to draw shapes below a threshold zoom level. By default shapes are not drawn below a threshold zoom level.

By default, the map control performs the following polyline and polygon shape performance optimizations at low zoom levels.

  • If a polyline or polygon is very small, it is not drawn.

  • If the latitude and longitude of two vertices of a polyline or polygon are too near each other, they are not drawn.

If this method is called with enable set to false, these optimizations are disabled and the map control does the following.

  • The map control attempts to draw the polyline or polygon, regardless of its size.

  • The map control attempts to draw all of the vertices of the polyline or polygon, regardless of how close they are to another vertex.

<!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;

         var Green = new VEColor(0, 255, 0, 0.5);

         var topLeft  = new VELatLong(47.8242, -122.3877);
         var topRight = new VELatLong(47.8242,  -122.0883);
         var botRight = new VELatLong(47.4689,  -122.0883);
         var botLeft  = new VELatLong(47.4689, -122.3877);

         function GetMap()
            map = new VEMap('myMap');
            map.LoadMap(new VELatLong(47.6987, -122.2503), 9);

            MyShape = new VEShape(VEShapeType.Polygon, new Array(topLeft, topRight, botRight, botLeft));


         function SetShapeThreshold(enable)
            if (enable.checked)
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>

      <input id="enablest" type=checkbox checked onclick="SetShapeThreshold(this)" />
         Enable Shape Threshold
         (click zoom out 4 times to see it disappear by default)