I am trying my first application with openlayers3 and geoserver. The code in the bottom of this message is not working. I know that geoserver is working properly because when I run the following link I can see the image represented by Img_Sample in it.
So what's wrong with the openlayers code?
Any help will be very much appreciated.
thanks
JJ
code
<html>
<head>
<title>OpenLayers Example</title>
<script src="http://openlayers.org/api/OpenLayers.js"></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
var map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"localhost:8081/geoserver/wms", {layers: 'Img_Sample'} );
map.addLayer(wms);
map.zoomToMaxExtent();
</script>
</body>