I have a MapServer layer, Roads in this instance, and I've set its STATUS to ON. I want to render this as a WMS service using OpenLayers. So I've set all the Metadata Section in the LAYER section in the MAP file. Then in OpenLayers I have the following snippet:
var params = {
LAYERS: 'Roads',
FORMAT: 'image/png',
VERSION: '1.1.1',
}
var source = new ol.source.ImageWMS({
url: 'http://localhost/cgi-bin/mapserv?map=/home/user/mapdata/fifth.map&layer=Roads',
params: params
});
var layer = new ol.layer.Image({
source: source
});
var center = ol.proj.transform([21.768006, 39.556202], 'EPSG:4326', 'EPSG:3857');
var view = new ol.View({
center: center,
zoom: 15
});
var map = new ol.Map({
target: 'map',
view: view,
renderer: 'dom'
});
map.addLayer(layer);
However, the layer is never rendered, although in the url I pass the layer=Roads parameter. If I set the STATUS to default in the map file everything works well but in this occasion, not. Any idea?
renderer: 'dom'
has been removed e.g github.com/openlayers/openlayers/releases/tag/v3.19.0