本文介绍了无法使用html2canvas捕获Google地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用html2canvas.hertzen.com的html2canvas捕获屏幕时遇到问题,当我在我的页面中捕获Google地图的Map时,我看不到地图

I have a problem when capture screen with html2canvas of html2canvas.hertzen.com, when I capture Map of google map in my page I can't see map

我的地图

我的截图

我的代码

My code

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

任何人都有小费?感谢

Anyone got a tip? Thanks

推荐答案

以下这些适用于我的Chrome和Firefox:

The following works for me for Chrome and Firefox:

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

其中server.js是
还有其他代理可用于PHP和Python,我还没有尝试过。我不能发布两个,但如果你谷歌html2canvas代理,你将能够找到其他人,如果你需要他们。

where server.js is https://github.com/niklasvh/html2canvas-proxy-nodejsThere are other proxies available for PHP and Python that I haven't tried yet. I cannot post both but if you google "html2canvas proxy" you'll be able to find the others if you need them.

这篇关于无法使用html2canvas捕获Google地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 09:19