为什么google地图和图表不支持html2canvas在javascript? [英] why google maps and charts are not supported by html2canvas in javascript?
本文介绍了为什么google地图和图表不支持html2canvas在javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Iam使用html2canvas使用此方法进行屏幕截图:
Iam doing screenshot using html2canvas with this method:
makeScreenshot: function (button) {
html2canvas(document.body, {
onrendered: function(canvas) {
new Ext.Window({
title: 'Screenshot',
width: 800,
height: 600,
resizable: true,
autoScroll: true,
preventBodyReset: true,
html: '<img src="' + canvas.toDataURL("image/png") + '" height="800"/>'
}).show();
}
});
}
获取此截图(在左侧对话框/ $ b
getting this screenshot (on the image left dialog/window named Screeshot)
看,google地图不生成,只是圈子。也不在屏幕截图中的图表。什么是错误?
as you can see, google map is not generated, just circles. also a charts ar not in the screenshot. what is wrong?
推荐答案
地图图块是可能无法呈现的图像,因为它们位于不同的域。
The map-tiles are images which may not be rendered, because the are located on a different domain.
从文档:
限制
脚本所使用的所有图像都需要位于同样的起源,它能够在没有代理人的帮助下阅读它们。
All the images that the script uses need to reside under the same origin for it to be able to read them without the assistance of a proxy.
这篇关于为什么google地图和图表不支持html2canvas在javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文