0

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?

1

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/

0

The Server Software providing the WMS is ArcGIS and not GeoServer, the ol.source.wms.ServerType parameter is used when the server software adds additional (vendor specific) capabilities, but ArcGIS doesn't do this, so this parameter should be omitted.

Allowed values are currently:

'carmentaserver', 'geoserver', 'mapserver', 'qgis'

So the following should work:

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'}
    }) 
});

Another issue may be the projection you are using, the layer in the WMS service you are calling only supports the following CRS:

<Layer>
  <Name>1</Name>
  <Title>Itzalak / Sombras MDT LIDAR 2012 5000</Title>
  <Abstract>Itzalak / Sombras MDT LIDAR 2012 5000</Abstract>    
  <CRS>CRS:84</CRS>
  <CRS>EPSG:4326</CRS>
  <CRS>EPSG:23030</CRS>
  <CRS>EPSG:25830</CRS>
  <EX_GeographicBoundingBox>
   <westBoundLongitude>-3.457379</westBoundLongitude>
   <eastBoundLongitude>-1.683561</eastBoundLongitude> 
   <southBoundLatitude>42.463020</southBoundLatitude>
   <northBoundLatitude>43.457532</northBoundLatitude>
  </EX_GeographicBoundingBox>

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.