try to draw 1000*1000 svg grig

This commit is contained in:
Gnieark 2016-06-29 12:14:01 +02:00
parent 4c628de03a
commit b219848f50

View File

@ -4,15 +4,20 @@ function createElem(type,attributes){
{elem.setAttribute(i,attributes[i]);} {elem.setAttribute(i,attributes[i]);}
return elem; return elem;
} }
function createElemNs(type,attributes){
var elem=document.createElement(type);
for (var i in attributes)
{elem.setAttributeNs(i,attributes[i]);}
return elem;
}
function tron(bot1,bot2,xdcheck){ function tron(bot1,bot2,xdcheck){
var mapImg = document.getElementById("map"); var svg = document.getElementById("map");
var svgDoc = svg.contentDocument;
var rect=createElemNs('rect',{'x':'10','y':'10','width':'50','height':'80','style':'stroke:#000000; fill:none;'});
var rect=createElem('rect',{'x':'10','y':'10','width':'50','height':'80','style':'stroke:#000000; fill:none;'}); svgDoc.appendChild(rect);
mapImg.appendChild(rect);
} }