VEMap.SetTileBuffer 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 number of "rings" of map tiles that should be loaded outside of the visible mapview area. This is also called tile overfetching.

VEMap.SetTileBuffer(numRings);

Parameters

Parameter Description

numRings

An integer value greater than or equal to 0 that indicates the number of rings of additional tiles that should be loaded. The default is 0, and the maximum is 3.

Remarks

This method can be called before VEMap.LoadMap Method to affect how tiles are loaded initially, but it can also be called at any time after the map is loaded to change the overfetch behavior.

Note

There are performance considerations with this method. Loading more rings may improve a user's initial map panning experience, but this may initially cause the page to load more slowly.

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;
         var value = 0;
 
         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap();

            map.SetMapStyle(VEMapStyle.Aerial);
            map.SetZoomLevel("5");         
         } 
     
         function SetVal(v)
         {
            value = v;
         }
     
         function SetTileBuffer()
         {
            map.SetTileBuffer(value);
            alert("The tile buffer has been set to " + value + 
               ".\nLarger buffer values improve panning," +
               "\nbut may also cause the page to load more slowly.");
         }  
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:400px; height:400px;">
      </div>
      <input id="btnSetBuffer" type="button" value="Set Tile Buffer" 
         onclick="SetTileBuffer()"><br />
      <form id="buffValues">
            0<input name="tbVal" type="radio" onclick="SetVal('0')" 
            checked="checked"/>&nbsp;|&nbsp;
            1<input name="tbVal" type="radio" onclick="SetVal('1')" />&nbsp;|&nbsp;
            2<input name="tbVal" type="radio" onclick="SetVal('2')" />&nbsp;|&nbsp;
            3<input name="tbVal" type="radio" onclick="SetVal('3')" />
      </form>
   </body>
</html>