Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Windows Live
VEMap Class
VEMap Methods
 SetPrintOptions Method
Virtual Earth Map Control SDK, version 6.1
VEMap.SetPrintOptions Method

This method controls how the map is printed.

VEMap.SetPrintOptions(printOptions);

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://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1"></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>
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker