(function(){ var PrintMap = {}; var LAYER_COUNT = 0; var LAYER_LENGTH = 0; window.MapToImg = PrintMap; PrintMap.excute = function(map){ var canvas = document.createElement("canvas"); var broz = SuperMap.Browser.name; if(!canvas.getContext||(broz=='msie'&&!canvas.msToBlob)){ alert("您的浏览器版本太低,请升级。"); return; } if(document.location.toString().match(/file:\/\//)){ alert("该功能需要在服务器中发布出来后,方可使用"); return; } LAYER_COUNT = 0; var layers = map.layers.concat([]); //layers排序,将markers放到最上边 var layers1 = []; for(var i=0;i=LAYER_LENGTH){ var canvas = document.createElement("canvas"); var size = map.getSize(); canvas.height = size.h; canvas.width = size.w; var ctx = canvas.getContext("2d"); canvas.style.position = "relative"; canvas.style.border = "1px solid #4c4c4c"; //document.body.appendChild(canvas); var panel = document.createElement("div"); panel.style.position = "absolute"; panel.style.left = "0px"; panel.style.top = "0px"; panel.style.height = "100%"; panel.style.width = "100%"; // panel.style.background = "#e6e8eb"; panel.style.background = "#ffffff"; document.body.appendChild(panel); var buttonPanel = document.createElement("div"); buttonPanel.style.position = "relative"; panel.appendChild(buttonPanel); panel.appendChild(canvas); window.setTimeout(function(){ for(var i=0;i