Why my "OpenLayers" not displayed added layer?

window.setWMS = function( WMSN ){
    window._blockEvents = true;
    var url = WMSN[0];
    var layer = WMSN[1];
    var server = WMSN[2];
    var wms = new ol.layer.Tile({
    source: new ol.source.TileWMS({
               url: url,
               params: {'LAYERS' : layer },
               serverType: server,
               crossOrigin: ''
    window._blockEvents = false;

URL: 'http://mapserver.heller-ig.de/osm/de/technical' Layer: 'Germany' Server: 'mapserver'

The layer does not appear.

e.g: URL: 'http://wms.geo.admin.ch/' Layer: 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung' Server: 'mapserver'

It works flawlessly.

  • Can be a lot of things. Give us the complete code or provide us a jsfiddle.net . It shouldn't be hard to debug. – oterral Jul 27 '15 at 9:24

If you use the default ol map, your map use probably the EPSG:3857 but your wms doesn't allow this CRS (see <CRS>tags in your GetCapabiltities). Allow this projection in the layer's definition of your WMS server config and it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.