Atlaslog / Field Notes / OpenLayers layers
Field note · OpenLayers layers
WMS layer is blank because the server returns ServiceException XML
Quick answer
Every GetMap request returns HTTP 200 with Content-Type application/vnd.ogc.se_xml, so the tile renders transparent and the console stays silent. The exception text names the bad parameter, usually a missing workspace prefix or a CRS/SRS mismatch.
Symptom
- The response body is ServiceExceptionReport with code LayerNotDefined and text: Layer not defined: roads.
- Content-Type is application/vnd.ogc.se_xml instead of image/png.
- Overlaid on the basemap the layer shows nothing, or covers the basemap with an opaque block when JPEG is used.
Checklist
- Copy the failing GetMap URL and open it directly in the browser.
- Check the response Content-Type before looking at pixels.
- Check LAYERS for the workspace prefix, for example workspace:roads.
- Check VERSION against the axis parameter: 1.1.1 uses SRS, 1.3.0 uses CRS with lat-first BBOX.
Fix
Build the source with LAYERS 'workspace:roads', STYLES '', VERSION '1.1.1', SRS 'EPSG:3857', FORMAT 'image/png' and TRANSPARENT true; for 1.3.0 use CRS and let OpenLayers order the BBOX axes.
Code
<?xml version="1.0" encoding="UTF-8"?>
<ServiceExceptionReport version="1.3.0">
<ServiceException code="LayerNotDefined">
Layer not defined: roads
</ServiceException>
</ServiceExceptionReport>map.getLayers().forEach(function (l) {
var src = l.getSource();
if (src instanceof ol.source.TileWMS) {
console.log(src.getFeatureInfoUrl(
map.getView().getCenter(),
map.getView().getResolution(),
'EPSG:3857',
{ INFO_FORMAT: 'text/html' }
));
}
});
Watch out
- Using FORMAT image/jpeg while requesting TRANSPARENT=true still paints an opaque rectangle over the basemap.
- Omitting the workspace prefix works only when the layer sits in the default workspace.
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Atlaslog (2026). WMS layer is blank because the server returns ServiceException XML. https://www.jingweizhi.com/en/cookbook/ol-wms-params-wrong.html (accessed 2026-11-03).