[OpenLayers-Users] Overlay Layer Status

Stephen Woodbridge woodbri at swoodbridge.com
Fri Apr 27 08:17:09 EDT 2007


andy wrote:
> Hi all,
> I have one base layer and several overlays layers. Is there a parameter 
> for choosing which layer must be active at startup, or they must be all 
> active at first loading of the page?
> 
> thank you,
> 
> a

For each layer you define, you can set the following options to true or 
false after they are defined.

            var base = new OpenLayers.Layer.MapServer.Untiled(
               ...
            );

            base.addOptions({isBaseLayer: true});
            base.setVisibility(true);

This will establish the initial state of that layer.

-Steve



More information about the Users mailing list