[OpenLayers-Users] How to have overlays off by default
Barker, Doug
dbarker at F-W.com
Thu Jul 2 09:47:14 EDT 2009
Very helpful. Thank you.
Also have been informed of using:
ce.setVisibility(false);
Thanks again,
Doug
________________________________________
From: users-bounces at openlayers.org [users-bounces at openlayers.org] On Behalf Of HKChad [forums at 2kgt.com]
Sent: Wednesday, July 01, 2009 10:28 PM
To: users at openlayers.org
Subject: Re: [OpenLayers-Users] How to have overlays off by default
You need to move the visibility option DOWN out of the params area.
If you look at the documentation,
http://dev.openlayers.org/docs/files/OpenLayers/Layer/WMS-js.html#OpenLayers.Layer.WMS.OpenLayers.Layer.WMS
You will see WMS takes 4 parameters, name, url, params, options
Visibility is an OPTION, not a params (params get sent as key/value pairs in
the URL query to the server).
so you need,
// CE
ce = new OpenLayers.Layer.WMS(
"CE", "http://localhost:8080/geoserver/wms",
{
width: '800',
layers: 'prof_reg:states50D_ce',
styles: '',
srs: 'EPSG:4269',
height: '317',
format: format,
transparent: true
},
{ singleTile: true,
ratio: 1,
visibility: false,
displayInLayerSwitcher: false
}
);
hope that helps,
Chad
Barker, Doug wrote:
>
> Hi,
> How do I have the overlays in a map turned off when the map starts up?
> I tried the two items below (commented out).
>
> // CE
> ce = new OpenLayers.Layer.WMS(
> "CE", "http://localhost:8080/geoserver/wms",
> {
> width: '800',
> layers: 'prof_reg:states50D_ce',
> styles: '',
> srs: 'EPSG:4269',
> height: '317',
> format: format,
> //displayInLayerSwitcher: false,
> //visibility: false,
> transparent: true
> },
> {singleTile: true, ratio: 1}
> );
>
> Thanks
> Doug
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
>
--
View this message in context: http://n2.nabble.com/How-to-have-overlays-off-by-default-tp3191421p3193414.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list