title: print google maps div with layers/markers
body: <p>How can I print Google Maps with all the layers/markers?</p>
  
  <p>Using <code>$('#map').html()</code> and placing contents in a new window doesn't work. It only shows the map base layer. For example, the below code doesn't work. </p>
  
  <pre><code>function PrintElem(elem)
  {
      Popup($(elem).html());
  }
  
  function Popup(data) 
  {
      var mywindow = window.open('', 'my div', 'height=400,width=600');
      mywindow.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;my div&lt;/title&gt;');
      /*optional stylesheet*/ //mywindow.document.write('&lt;link rel="stylesheet" href="main.css" type="text/css" /&gt;');
      mywindow.document.write('&lt;/head&gt;&lt;body &gt;');
      mywindow.document.write(data);
      mywindow.document.write('&lt;/body&gt;&lt;/html&gt;');
  
      mywindow.document.close(); // necessary for IE &gt;= 10
      mywindow.focus(); // necessary for IE &gt;= 10
  
      mywindow.print();
      mywindow.close();
  
      return true;
  }
  </code></pre>
  
  <p>Would also be nice to fit the map to landscape/portrait for printing.</p>