Leaflet map polygon not shown on canvas when using html2canvas

rob.m

This is what I am doing, a click on a button and drawing my page body into a canvas

jQuery("#print").on("click", function() {
    myCapture();
});

function myCapture() {
  html2canvas(document.body, {
    allowTaint: true,
    useCORS: true,
    onrendered: function(canvas) {
      document.body.appendChild(canvas);
    }
  });
}

That works but the map is shown without any polygon

rob.m

I resolved it by telling leaflet to provide tiles as canvas and not as an svg

jQuery("#print").on("click", function() {
    myCapture();
});

function myCapture() {
  html2canvas(document.body, {
    allowTaint: true,
    useCORS: true,
    onrendered: function(canvas) {
      document.body.appendChild(canvas);
    }
  });
}

   var map = L.map('map', {
        renderer: L.canvas()
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Polygon on google maps taints canvas when using html2canvas

From Dev

Google Map screen capture is not working for marker and marker cluster using html2canvas

From Dev

The ability to download an d3.js overlay on a google map using html2canvas

From Dev

Google Map screen capture is not working for marker and marker cluster using html2canvas

From Dev

Textarea screenshot using Html2Canvas

From Dev

Print page using html2canvas

From Dev

Gap when drawing polygon on canvas

From Dev

Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

From Dev

Html2canvas - capture google map to image in phonegap application

From Dev

How to set custom file name when exporting html element to Png file using html2canvas in jquery?

From Dev

convert html with highcharts graph to image using html2canvas

From Dev

angularjs unsafe:data; when capturing screenshot with html2canvas

From Dev

Is there a way in leaflet to get the coordinates of a map click when clicking on a polygon?

From Dev

Screenshoting MapBox using html2canvas creates a black jpg

From Dev

Saving Morris charts to image using HTML2CANVAS

From Dev

Saving Morris charts to image using HTML2CANVAS

From Dev

unable to dispaly polygon on the map using Leaflet draw plugin

From Dev

Google Chrome draws the polygon when using map tag in HTML

From Dev

How to draw a polygon on a tkinter canvas using a class?

From Dev

HTML canvas breaking when keyboard is shown at landscape orientation

From Dev

HTML canvas breaking when keyboard is shown at landscape orientation

From Dev

Add polygon to map R leaflet

From Dev

can't change div element to canvas using html2canvas in asp.net

From Dev

HTML Canvas, blurring drawn polygon

From Dev

drawing polygon in canvas jquery html

From Dev

TypeScript and Html2Canvas?

From Dev

Fill polygon on canvas

From Dev

Polygon not being drawn on Canvas

From Dev

html2canvas is not working properly while taking snap of a div containing gmap (Google Map)

Related Related

  1. 1

    Polygon on google maps taints canvas when using html2canvas

  2. 2

    Google Map screen capture is not working for marker and marker cluster using html2canvas

  3. 3

    The ability to download an d3.js overlay on a google map using html2canvas

  4. 4

    Google Map screen capture is not working for marker and marker cluster using html2canvas

  5. 5

    Textarea screenshot using Html2Canvas

  6. 6

    Print page using html2canvas

  7. 7

    Gap when drawing polygon on canvas

  8. 8

    Empty PDF report is generated when we have multiple graphs using html2canvas and jsPDF library

  9. 9

    Html2canvas - capture google map to image in phonegap application

  10. 10

    How to set custom file name when exporting html element to Png file using html2canvas in jquery?

  11. 11

    convert html with highcharts graph to image using html2canvas

  12. 12

    angularjs unsafe:data; when capturing screenshot with html2canvas

  13. 13

    Is there a way in leaflet to get the coordinates of a map click when clicking on a polygon?

  14. 14

    Screenshoting MapBox using html2canvas creates a black jpg

  15. 15

    Saving Morris charts to image using HTML2CANVAS

  16. 16

    Saving Morris charts to image using HTML2CANVAS

  17. 17

    unable to dispaly polygon on the map using Leaflet draw plugin

  18. 18

    Google Chrome draws the polygon when using map tag in HTML

  19. 19

    How to draw a polygon on a tkinter canvas using a class?

  20. 20

    HTML canvas breaking when keyboard is shown at landscape orientation

  21. 21

    HTML canvas breaking when keyboard is shown at landscape orientation

  22. 22

    Add polygon to map R leaflet

  23. 23

    can't change div element to canvas using html2canvas in asp.net

  24. 24

    HTML Canvas, blurring drawn polygon

  25. 25

    drawing polygon in canvas jquery html

  26. 26

    TypeScript and Html2Canvas?

  27. 27

    Fill polygon on canvas

  28. 28

    Polygon not being drawn on Canvas

  29. 29

    html2canvas is not working properly while taking snap of a div containing gmap (Google Map)

HotTag

Archive