[GIS] Problems with a wms layer in Openlayers 3

openlayerswms

First of all sorry if my English isn't good.

I'm trying to add a layer into an OpenLayers 3 map. This one is which I want to insert:

new ol.layer.Image({
    name: 'cartografia',
    style: 'cartografia',
    visible: true, 
    source: new ol.source.ImageWMS({
        url: 'http://www.geo.euskadi.net/arcgis/services/U11_AGS_WMS_Cartografia/MapServer/WMSServer?', 
        params: { 
            'LAYERS': '1',
            'STYLES': 'default' 
        },
        serverType: 'geoserver' }) })

When I go to http://www.geo.euskadi.net/arcgis/services/U11_AGS_WMS_Cartografia/MapServer/WMSServer?request=getcapabilities into the browser, I can see the xml, but I'm not able to insert the layer

What I'm doing wrong?

Best Answer

It's a ArcGIS Server and not Geoserver that delivers the WMS.

( See http://www.geo.euskadi.net/arcgis/rest/services )

so this should work:

new ol.layer.Image({
         source: new ol.source.ImageWMS({
            url: 'http://www.geo.euskadi.net/arcgis/services/U11_AGS_WMS_Cartografia/MapServer/WMSServer?',
             ratio: 1,
             params: {
                 'LAYERS': '1',
                     'TRANSPARENT': 'true'
             }
         })
     });

see http://jsfiddle.net/expedio/njnf55fp/

Related Question