需求为:对专题图分层设色后的地图进行下载,下载页面在自己的Tomcat上,调用地图资源时出现了跨域问题。地图中的图层在页面中为canvas,而不能执行canvas中的toUrl方法,无法生成图片。急求大神指点
报错:
index.js:235 Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
at pasteCanvas (http://localhost:8080/Test/index.js:235:30)
at onloadHTML (http://localhost:8080/Test/index.js:223:6)