I'm trying to access a WMS endpoint through Openlayers to display the data in a slippy map.
Here's my code:
var basemap = new ol.source.TileWMS( " Layer Name 1", "http://localhost:8080/geoserver/oswgc-india/wms", {layers: 'oswgc-india:india_grouplayer'} );
var map = new ol.Map({
layers: [
basemap
],
target: 'map',
view: new ol.View({
center: [312406.33, 6150500.21],
zoom: 5
})
});
In Geoserver, I have created a grouped layer called india_grouplayer in the workspace oswgc-india. However, my index.html with the embedded JavaScript just returns a blank page. I suspect that I'm missing configuration options in Geoserver, as I'm not exactly very familiar with the software.