I have the following basic OpenLayers 3 code that opens a OSM background mapping and this works fine:
<!doctype html>
<html>
<head>
<title>Hello PMS</title>
<link rel="stylesheet" href="../assets/ol3/css/ol.css" type="text/css" />
<link rel="stylesheet" href="../assets/css/samples.css" type="text/css" />
</head>
<body>
<div id="map" class="map"></div>
<script src="../assets/ol3/js/ol-debug.js"></script>
<script>
var osmLayer = new ol.layer.Tile({
source: new ol.source.OSM()
});
var uk_centre = ol.proj.transform([-2.547855, 54.00366], 'EPSG:4326', 'EPSG:3857');
var view = new ol.View({
center: uk_centre,
zoom: 6
});
var map = new ol.Map({
target: 'map'
});
map.addLayer(osmLayer);
map.setView(view);
map.addControl(new ol.control.FullScreen());
</script>
</body>
</html>
I am now looking to bring in a WMS layer from GeoServer with the code below, where would it be placed and what needs to be changed?
var pms = new ol.layer.WMS("PMS",
"http://10.0.1.127:8080/geoserver/PMS/wms",
{layers: 'PMS:QGIS'} );
map.addLayer(pms);