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

Moves the map in the specified direction until the VEMap.EndContinuousPan Method is called.

VEMap.StartContinuousPan(x, y);

Parameters

Parameter Description

x

The speed, as a percentage of the fastest speed, to move the map in the x direction. Positive numbers move the map to the right, while negative numbers move the map to the left

y

The speed, as a percentage of the fastest speed, to move the map in the y direction. Positive numbers move the map down, while negative numbers move the map up

Remarks

The StartContinuousPan method moves the map in the direction specified by the two variables. The direction is specified by the relative speed of the two parameters. For example, the following code moves the map as fast as the client computer can to the right:

map.StartContinuousPan(100,0);

The following code moves the map to the right at 30% of the fastest speed and up at 20% of the fastest speed:

map.StartContinuousPan(30,-20);

To stop panning the map, call the VEMap.EndContinuousPan Method.

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();
         }
        
         function StartContinuousPan()
         {
            map.StartContinuousPan(document.getElementById('panX').value, document.getElementById('panY').value);
         }
        
         function EndContinuousPan()
         {
            map.EndContinuousPan();
         }
      </script>
   </head>
   <body onload="GetMap();" style="font-family:Arial">
      <div id='myMap' style="position:relative; width:400px; height:400px;"></div>
      <INPUT id="startpan" type="button" value="Start Panning" name="startpan" 
         onclick="StartContinuousPan();"/>
      X: 
      <INPUT id="panX" type="text" value="1" name="panX" size="3"/>
      &nbsp;&nbsp;&nbsp;
      Y: 
      <INPUT id="panY" type="text" value="1" name="panY" size="3"/>
      <br />
      <INPUT id="endpan" type="button" value="End Pan" name="endpan" 
         onclick="EndContinuousPan();"/>
   </body>
</html>