VEMap.SetTileBuffer Method
VEMap.SetTileBuffer Method

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.

Bb412434.note(en-us,MSDN.10).gifNote:
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" "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.2"></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>

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View