[OpenLayers-Users] Performance Tuning in Internet Explorer

Pavel Iacovlev iacovlev.pavel at gmail.com
Tue Sep 22 10:41:32 EDT 2009


If you have so many shapes you could:
1) Reduce the number of shapes to like 100
2) Render your layer server-side and serve it via WMS-C for example

Depends what are you using your vector layer for, as a workground you
can: on small scales use the "WMS layer" of your data and on big
scales use the "vector layer".

On Tue, Sep 22, 2009 at 5:34 PM,  <jim.meyer at concept-solutions.com> wrote:
> 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
>
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>



-- 
http://iap.md, The future is open



More information about the Users mailing list