[OpenLayers-Users] Question on having multiple layers

Eric Lemoine eric.c2c at gmail.com
Wed Aug 8 14:36:23 EDT 2007


Hi Ali,

On 8/8/07, Ali Khan <akhan at unfpa.org> wrote:
> Hey, presently we're developing a system that will have MANY layers
> we're talking 20-50.
>
> I know in OpenLayers you need to setup a name etc for each layer. I was
> thinking using a loop to output each layer (the basic data ie layer name
> etc is stored in a backend database). Still when somoene opens up the
> navigation tab though it can become quite long.

Don't use one OpenLayers layer per server layer, it'll result in a
performance disaster! Group your layers into as few OpenLayer layers
as possible. For example, if you use WMS, group your layers using
OpenLayers.Layer.WMS's 'layers' param, and switch from one layer to
another using the mergeNewParams() method.

Hope this helps...

--
Eric



More information about the Users mailing list