Use html2canvas instead of dom-to-image

This commit is contained in:
Andreas Hocevar
2021-06-20 23:41:44 +02:00
parent e82a86f563
commit 670ea6db9d
5 changed files with 32 additions and 27 deletions

View File

@@ -7,12 +7,11 @@ docs: >
The print is exported as a PDF using the <a href="https://github.com/MrRio/jsPDF" target="_blank">jsPDF</a> library.
Unlike the <a href="export-pdf.html">Export PDF example</a> the on screen map is only used to set the center and rotation.
The extent printed depends on the scale and page size. To print the scale bar and attributions the example uses the
<a href="https://github.com/1904labs/dom-to-image-more" target="_blank">dom-to-image-more</a> library. Due to browser
limitations and restrictions <b>Internet Explorer and Safari are not supported</b>.
<a href="https://html2canvas.hertzen.com/" target="_blank">html2canvas</a> library.
tags: "print, printing, scale, scaleline, export, pdf"
resources:
- https://unpkg.com/dom-to-image-more@2.8.0/dist/dom-to-image-more.min.js
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.min.js
- https://html2canvas.hertzen.com/dist/html2canvas.min.js
- https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.3.1/jspdf.umd.min.js
---
<div class="wrapper">
<div id="map" class="map"></div>