Click to Rate and Give Feedback
MSDN
MSDN Library
Bing Services
Bing Maps SDKs
VEMap Class
VEMap Methods
 SetShapesAccuracy Method

  Switch on low bandwidth view
VEMap.SetShapesAccuracy Method

Specifies the accuracy in converting shapes when the map style is changed to birdseye.

VEMap.SetShapesAccuracy(policy);

Parameters

Parameter Description

policy

The VEShapeAccuracy Enumeration value specifying the accuracy in converting shapes.

By default, shapes are not subject to increased accuracy representation when the map style is set to birdseye (the default accuracy is VEShapeAccuracy.None). Use this method to improve the accuracy of shapes when setting the map style to birdseye. By default, up to 50 shapes are converted at a time. To change this value, use the VEMap.SetShapesAccuracyRequestLimit Method.

The example uses the following custom images.

Bb877873.308601ce-86f6-46fc-8bfb-2d5d97688b15(en-us,MSDN.10).gif Bb877873.8c503060-0bbd-4e3e-bd49-38739442678b(en-us,MSDN.10).gif
JScript
<!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;

         function GetMap()
         {
            map = new VEMap('myMap');
            map.onLoadMap = DoAfterMapLoaded;
            map.LoadMap(new VELatLong(47.6215, -122.3472), 17, VEMapStyle.Road);
         }

         function DoAfterMapLoaded()
         {
            // Show pushpins accurately,
            // User can disable by deselecting check button before selecting birdseye
            map.SetShapesAccuracy(VEShapeAccuracy.Pushpin);

            // Don't try to show extra shapes
            map.SetFailedShapeRequest(VEFailedShapeRequest.DoNotDraw);

            // Convert a max of 10 points accurately at a time
            map.SetShapesAccuracyRequestLimit(10);

            var FifthAndHarrison  = new VELatLong(47.62205, -122.34753);
            var HarrisonAndTaylor = new VELatLong(47.62205, -122.34627);
            var TaylorAndBroad    = new VELatLong(47.6217, -122.34627);
            var FifthAndBroad     = new VELatLong(47.6207, -122.34753);

            var pushpin1 = new VEShape(VEShapeType.Pushpin, FifthAndHarrison);
            pushpin1.SetCustomIcon("images/RedX16.gif");
            var pushpin2 = new VEShape(VEShapeType.Pushpin, HarrisonAndTaylor);
            pushpin2.SetCustomIcon("images/RedX16.gif");
            var pushpin3 = new VEShape(VEShapeType.Pushpin, TaylorAndBroad);
            pushpin3.SetCustomIcon("images/RedX16.gif");
            var pushpin4 = new VEShape(VEShapeType.Pushpin, FifthAndBroad);
            pushpin4.SetCustomIcon("images/RedX16.gif");

            map.AddShape(pushpin1);
            map.AddShape(pushpin2);
            map.AddShape(pushpin3);
            map.AddShape(pushpin4);
         }

         function CheckBoxClicked(cb)
         {
            var shapeAccuracy = VEShapeAccuracy.None;

            if (cb.checked)
            {
               shapeAccuracy = VEShapeAccuracy.Pushpin;
            }

            map.SetShapesAccuracy(shapeAccuracy);
         }
      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>

      <input id='CB1' type=checkbox checked onclick="CheckBoxClicked(this)" />
      Enable Birdseye Accuracy
      <br/>
     (you don't really notice it until you look west in birdseye by clicking the
     <img border="0" src="images/CounterClockwise.gif" width="22" height="21">
     button once).
   </body>
</html>
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker