[OpenLayers-Dev] Performance question

Antonio Volpicelli volpicelli at oato.inaf.it
Mon Jul 30 12:05:13 EDT 2007


Hi Eric,
I have about 50 requests per layer. This when I go up with the zoom.
Now I am using the Mapserver class , probably I will switch to WMS.
You told me about buffer:0 but I didn't find in the docs this parameter 
for the Mapserver class.
I wrote a line like this:
 layers[2] = new OpenLayers.Layer.MapServer( "AIS",
                    wmsserver, {layers: 'AIS',format: 
"image/png",transparent: true,buffer:0});
Is it correct?

Thanks , now I am using the setVisibility method and the application is 
a little better.

Thanks Chris I used the shptree and indexed my shape files.

Yes I am agree that 11 layers could be a lot but for this application 
the users might ask to see the distribution on the sky of all these 
layers/surveys
So I made those change and it seems to me faster then before.
You can check this application at :

http://mastmap.stsci.edu/galex/map/shapes/stshapesAll.html

Thanks

Antonio

Eric Lemoine wrote:
> 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