So trying to work through the setup of geoserver and using an example script see below.
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<link rel="stylesheet" href="http://openlayers.org/en/v3.15.1/css/ol.css" type="text/css">
<script src="http://openlayers.org/en/v3.15.1/build/ol.js"></script>
</head>
<body>
<div id="map" class="map"></div>
<script>
var layers = [
new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
}),
new ol.layer.Tile({
extent: [-13884991, 2870341, -7455066, 6338219],
source: new ol.source.TileWMS({
url: 'http://localhost:8080/geoserver/cite/wms',
params: {'LAYERS': 'topp:states', 'TILED': true},
serverType: 'geoserver'
})
})
];
var map = new ol.Map({
layers: layers,
target: 'map',
view: new ol.View({
center: [-10997148, 4569099],
zoom: 4
})
});
</script>
</body>
</html>
When opening the page though i cannot see the sample shapefiles 'topp:states' Anyone know what i am doing wrong?
I assume i have something wrong with the URL for the source.
http://localhost:8080/geoserver/cite/wms?request=GetCapabilities&service=WMS&