jaywhy13
05-02-2008, 07:36 PM
Have a look at this scriptlet...
var points = rootElement.getElementsByTagName("point");
for(var p = 0; p < 300; p++) {
mShowMessage("Loading " + p + " of " + points.length);
var point = points.item(p);
var x,y,id;
x = point.getAttribute("x");
y = point.getAttribute("y");
id = point.getAttribute("id");
var pointObj = xmlOverlay.addNewPoint(id,x,y);
var symbols = point.getElementsByTagName("symbol");
var symbolObjs = new Array();
for(var s = 0; s < symbols.length; s++){
var symbol = symbols.item(s);
var symbolObj = new kaXmlSymbol();
symbolObj.size = symbol.getAttribute("size");
symbolObj.color = symbol.getAttribute("color");
pointObj.addGraphic(symbolObj);
}
}
Very simple... this loop... It basically adds points to a map. It's all adding clipped divs to the DOM. Problem, when the number goes much higher than say 400 points... there's a small period that if you click the browser it FREEZES up totally. What can I do to remedy that... I figure the DOM is under ALOT of pressure... so how can I relieve it?
var points = rootElement.getElementsByTagName("point");
for(var p = 0; p < 300; p++) {
mShowMessage("Loading " + p + " of " + points.length);
var point = points.item(p);
var x,y,id;
x = point.getAttribute("x");
y = point.getAttribute("y");
id = point.getAttribute("id");
var pointObj = xmlOverlay.addNewPoint(id,x,y);
var symbols = point.getElementsByTagName("symbol");
var symbolObjs = new Array();
for(var s = 0; s < symbols.length; s++){
var symbol = symbols.item(s);
var symbolObj = new kaXmlSymbol();
symbolObj.size = symbol.getAttribute("size");
symbolObj.color = symbol.getAttribute("color");
pointObj.addGraphic(symbolObj);
}
}
Very simple... this loop... It basically adds points to a map. It's all adding clipped divs to the DOM. Problem, when the number goes much higher than say 400 points... there's a small period that if you click the browser it FREEZES up totally. What can I do to remedy that... I figure the DOM is under ALOT of pressure... so how can I relieve it?