I am using the google map api v2. When I go to print the map, the controls are being displayed on the print out. How can I set GLargeMapControl and GMapTypeControl not to print?
I seen in the API there is a GControl Printable constuctor but can not find any information on its usage.
I have tried using these 2 functions:
function Clickheretoprint() { var disp_setting="toolbar=no,location=no,directories=no,menubar=no,"; disp_setting+="scrollbars=no,width=650, height=600, left=100, top=25"; var content_vlue = document.getElementById("gm").innerHTML;
var docprint=window.open("","",disp_setting); docprint.document.open(); docprint.document.write('<html><head><title>Inel
Power System');
docprint.document.write('</head><body
class="gmnoprint print" onLoad="window.print();window.close()">'); docprint.document.write(content_vlue); docprint.document.write(''); docprint.document.close(); docprint.focus(); }
and
function ClickHereToPrint(){ try {
var oIframe =
document.getElementById('ifrmPrint'); var oContent = document.getElementById('gm').innerHTML; var oDoc = (oIframe.contentWindow || oIframe.contentDocument); if (oDoc.document) oDoc = oDoc.document; oDoc.write("title"); oDoc.write(""); oDoc.write(oContent + ""); oDoc.close(); }
catch(e){
self.print();
}
}
In the HTML page I have:
var lat, lon, init_zoom; lat = 44.9647979303; lon = -99.84375; init_zoom = 3;
Google Maps Print test<script type="text/javascript" src="mapscripts.js"></script> </head>
<div id="bottomDiv" class="clsBottomDiv" align="left"> <table> <tr> <td> Search for Address: <form onSubmit="return Geocode()"> <input id="search" type="text" size="60"
/>
</tr> </table> </div> </td> </tr> </table> </div> </body> </html>
I tried giving the iframe a class of gmnoprint also with no luck.