[OpenLayers-Users] Performance Tuning in Internet Explorer
jim.meyer at concept-solutions.com
jim.meyer at concept-solutions.com
Tue Sep 22 10:34:42 EDT 2009
Hi,
We are rendering a vector layer that has 1000+ shapes. Currently, it is
very slow in IE. Any ideas as to where to start to improve performance?
The code that is being used to render this layer is below:
shapeStore.on('load', function(ds){
timeStore.loadData(shapeStore.reader.jsonData);
// Build the array of points
for (var i = 0; i < shapeStore.getCount(); i++) {
pointsArr.length = 0;
pointArr.length = 0;
theArr.length = 0;
theArrIdx = 0;
pointsArr = shapeStore.getAt(i).data.geom.split(",");
shapeStyle = shapeStore.getAt(i).data.style;
for (var x = 0; x < pointsArr.length; x++) {
pointArr = pointsArr[x].split(" ");
theArr[theArrIdx++] = new
OpenLayers.Geometry.Point(pointArr[0],pointArr[1]);
}
var theLinearRing = new OpenLayers.Geometry.LinearRing(theArr);
var thePolygon = new
OpenLayers.Geometry.Polygon(theLinearRing);
var theAttributes = {
airspace_name: shapeStore.getAt(i).data.airspace_name
}
var theFeature = new
OpenLayers.Feature.Vector(thePolygon,theAttributes,eval(shapeStyle));
shapes_layer[0].addFeatures([theFeature]);
}
// Update the Map Time
var theDateSpan = document.getElementById('thedate');
theDateSpan.innerHTML = timeStore.getAt(0).data.thedate + ", " +
timeStore.getAt(1).data.thedate;
});
shapeStore.load();
Thanks,
Jim
Jim Meyer
Java Programmer
ConceptSolutions, LLC
We Make Business Intelligent
703.889.8434 [desk]
703.391.9041[fax]
www.Concept-Solutions.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090922/41f04c94/attachment.html
More information about the Users
mailing list