1

I'm trying to add a WMTS layer in an OpenLayers3 project. I'm able to add this layer in QGIS. Here is the service address: http://www.ngi.be/cartoweb/1.0.0/WMTSCapabilities.xml.

In OpenLayers3, I tried several combination of parameters. The last in date is this one:

var ignLayer = new ol.layer.Tile({
     source: new ol.source.TileWMS({
     url: 'http://www.ngi.be/cartoweb/1.0.0/WMTSCapabilities.xml',
     params: {
          'Layer': 'CartoWeb-Topo',
          'Tileset': '3857',
          },
     format: 'image/png'
     })
 });

Do you think am I missing a mandatory parameter? Or maybe the source TileWMS is not the one to use?

Here are the results of GET queries: WMST Get Requests Results

3
  • Do you get any error message? Does the service respond anything?
    – ulrich
    Commented Apr 12, 2016 at 9:39
  • Yes. The service respond a 200 HTTP Status Code. But the results are empty images. I added an image of the GET queries results.
    – pzijd
    Commented Apr 12, 2016 at 12:15
  • 1
    I assume, that you use the wrong URL. The one you show is probably only the capabilities document. If you have a look in there for ResourceURL, it tells you, which path to use: ResourceURL resourceType="tile" template="http://www.ngi.be/cartoweb/1.0.0/topo/{style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png" format="image/png"/>
    – ulrich
    Commented Apr 12, 2016 at 12:49

1 Answer 1

2

Thanks to your comments, I'm now able to add the belgian NGI WMTS to an OpenLayers3 project. Here is how:

var belgiumExtent = [280000, 6360000, 710000, 6710000];

var ignMap = new ol.layer.Tile({
    extent: belgiumExtent,
    source: new ol.source.XYZ({
        url: 'http://www.ngi.be/cartoweb/1.0.0/' +
           'topo/default/3857/{z}/{y}/{x}.png'
    })
 });

As you notice, I'm using the XYZ format. I didn't figure out how to use the WMTS format. Maybe here is a way to do it: http://openlayers.org/en/v3.15.1/examples/wmts-ign.html?q=wmts.

Moreover, I'm using the Google Mercator projection (EPSG:3857). If you need it, the belgian Lambert 2008 projection is also available (EPSG:3812).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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