[OpenLayers-Dev] Performance question

Eric Lemoine eric.c2c at gmail.com
Sat Jul 28 08:27:11 EDT 2007


On 7/28/07, Antonio <volpicelli at oato.inaf.it> wrote:
> Hi dev,

Hi Antonio

> In my application I need to overlay 11 layers.
> One of these has about 15000 entries in its shapefile. Each entry is a
> polygon ( a rectangle ) and the vertices are in meters because I use a
> Mollweide(54004) projection.
> So I add these 11 layers in the my map object  and the first time at the
> max extent bounds it is fast.
> When I zoom in the performances are very very poor and when I go to the
> max zoom level I can see that the requests send to the web server are
> about 1000.

You mean you see about 1000 HTTP requests to the server? About 90
tiles per layer isn't what I'd expect.

Btw, what type of layer do you use? WMS? I guess this is a tiled layer...

> I suppose too that for each of these 1000 requests to MapServer  has it
> to scan 15000 entries to get just only the polygons that are inside the
> requested tile? Is it right?

Dunno exactly. I'll let others comment on that one...

> So I tried to add just one layer , clearly the performance is better but
> at max zoom level the requests to the web server are about 50.

This is again a lot of requests. If you indeed use a tiled layer, have
you tried setting  the 'buffer' property to 0. See
<http://dev.openlayers.org/docs/files/OpenLayers/Layer/Grid-js.html>
for a description of that property.

> My question is:
> 1) Is it possible to change the area , and then the number of tiles ,
> and I suppose the number of requests ,  that OL ask to cover around the
> visible area ( what my visible extent is on the browser) .

See my previous comment.

>  2) When I add the layers to the map object and then add the
> LayerSwitcher control , all the overlay layers are checked. It is
> possible to set some layers at unchecked status

There's the 'visible' property for that, which you can pass to the
layer constructor. See
<http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer>

> 3) I have seen that is easy to add layers to the map dynamically  , but
> is not so easy to remove they. There are some one that has the code to
> do that?

Well there's the removeLayer() method for exactly that :
<http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.removeLayer>

> Thanks a lot

Hope this helps.

--
Eric



More information about the Dev mailing list