Database Reference
In-Depth Information
7. Now,createaWMSGeoServerlayertodisplaytheOpenLayersmapofthe
counties from the PostGIS layer. You will set some opacity for this layer so
thatitispossibletoseetheotherlayer(counties)behindit.The isBaseLay-
er property is set to false , since you want to have this layer over the
Google Maps base layers and not as an alternative to them (by default, all
oftheWMSlayersinOpenLayersareconsideredtobebaselayers).Create
the WMS GeoServer layer using the following code:
// set the GeoServer WMS
var geoserver_wms = new
OpenLayers.Layer.WMS( "GeoServer WMS",
geoserver_url,
{
layers: "postgis_cookbook:counties",
transparent: "true",
format: "image/png",
},
{
isBaseLayer: false,
opacity: 0.4
} );
8. Now, create a WMS MapServer layer to display the countries from the
PostGIS layer in the OpenLayers map, using the following code:
// set the MapServer WMS
var mapserver_wms = new
OpenLayers.Layer.WMS( "MapServer WMS",
mapserver_url,
{
layers: "countries",
transparent: "true",
format: "image/png",
},
{
isBaseLayer: false
} );
Search WWH ::




Custom Search