title: Openlayers 3 print map div
body: <p>Is there a native way to print the "map" div?</p>
  
  <p>I've tried a couple different approaches...</p>
  
  <pre><code>var printContents =  document.getElementById("map").outerHTML;
                      var popupWin = window.open('', '_blank', 'width=600,height=300');
                      popupWin.document.open();
                      popupWin.document.write('&lt;html&gt;&lt;head&gt;&lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;&lt;/head&gt;&lt;body onload="window.print()"&gt;' + printContents + '&lt;/body&gt;&lt;/html&gt;');
                      popupWin.document.close();
  </code></pre>
  
  <p>And also...</p>
  
  <pre><code>var divContents = $("#map").html();
                      var printWindow = window.open('', '', 'height=400,width=800');
                      printWindow.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;DIV Contents&lt;/title&gt;');
                      printWindow.document.write('&lt;/head&gt;&lt;body &gt;');
                      printWindow.document.write(divContents);
                      printWindow.document.write('&lt;/body&gt;&lt;/html&gt;');
                      printWindow.document.close();
                      printWindow.print();
  </code></pre>
  
  <p>Both of these open a browser print window but both have a blank preview, it seems the code is finding the "map" div but not able to get the full HTML or something?</p>
  
  <p>Any help is greatly appreciated!!</p>