Failed to capture google map with html2canvas

I have a problem capturing a screen with html2canvas html2canvas.hertzen.com, when I take the google map map on my page, I cannot see the map.

My map

My capture

My code

html2canvas(document.body, { onrendered: function(canvas) { document.body.appendChild(canvas); } }); 

Anyone got a clue? Thanks

+5
source share
1 answer

The following steps are for me for Chrome and Firefox:

 html2canvas(document.body, { proxy: "server.js", useCORS: true, onrendered: function(canvas) { document.body.appendChild(canvas); } }); 

where server.js https://github.com/niklasvh/html2canvas-proxy-nodejs There are other proxies for PHP and Python that I have not tried yet. I can’t publish both, but if you google "html2canvas proxy", you can find others if you need them.

+4
source

Source: https://habr.com/ru/post/944852/


All Articles