Click to Rate and Give Feedback
MSDN
MSDN Library
Online Services
Bing Services
Bing Maps SDKs
VEMap Class
VEMap Methods
 SetPrintOptions Method
Collapse All/Expand All Collapse All
VEMap.SetPrintOptions Method

This method controls how the map is printed.

VEMap.SetPrintOptions(printOptions);

Parameters

Parameter Description

printOptions

A VEPrintOptions Class specifying the print options to set.

The default value for the VEPrintOptions.EnablePrinting Property is false, which means printing support is off by default.

There may be a decrease in the performance of the map control if the VEPrintOptions.EnablePrinting Property is equal to true.

JScript
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
   <head>
      <title>VEMap.SetPrintOptions()</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 shape = null;
         
         var pinCenter = null; 
         
         function GetMap()
         {
            map = new VEMap('myMap');
            map.LoadMap();

            // Add a pushpin
            pinCenter = new VELatLong(45.01188,-111.06687);
            shape = new VEShape(VEShapeType.Pushpin, pinCenter);
            map.AddShape(shape);

            //Set the map view to see the pushpin
            map.SetCenter(pinCenter);

         }

         function PrintMap()
         {
            //Enable printing
            var printOpt = new VEPrintOptions(true);
            map.SetPrintOptions(printOpt);
        
            // Print the map 
            window.print();    

         }

      </script>
   </head>
   <body onload="GetMap();">
      <div id='myMap' style="position:relative; width:600px; height:400px;"></div>
      <input id="btnprint" type="button" value="Click to print the map" onclick="PrintMap();"/>
   </body>
</html>
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker