iClient Classic 正常显示的SuperMap.CanvasLayer导出toDataURL时报错 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. 使用超图的MapToImg.js文件进行的地图截图操作报错
//截取canvas图层
function getCanvasLayerData(layer) {
var div = layer.div;
var canvas0 = div.getElementsByTagName("canvas")[0];
var imageUrl = canvas0.toDataURL("image/png");
var img = new Image();
img.setAttribute('crossOrigin', 'anonymous');
img.src = imageUrl;
return img;
}
已确认这个报错图层是正常获取的,且可以看到其canvas元素并肯定是支持canvas的,请问如何处理?