How to overlay a WMS layer from GeoServer (localhost)in OpenLayers?
What is the basic syntax of a GeoServer WMS layer?
Details are as follows:
workspace name: india
layer name:hospitals
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", "labs.metacarta.com/wms/vmap0";, {layers: 'basic'} );
var twms = new OpenLayers.Layer.WMS( "World Map", "localhost:8080/geoserver/wms?service=WMS&version=1.1.1& request=GetCapabilities&",
{
map: 'hospitals',
transparent: 'true',
layers: 'hospitals'
} );
map.addLayers([wms, twms]);
map.zoomToMaxExtent();
</script>
i tried the basic wms layer, now i want to overlay my layers from geoserver
doesn't make any sense. There should be no syntax difference. If it's not working for you, and you are hosting the GeoServer WMS service, perhaps you should look first at getting your WMS working first.