Based on the OpenLayers example at https://openlayers.org/en/latest/examples/wmts-layer-from-capabilities.html?q=wmts

I'm trying to load a WMTS in my own example here https://codepen.io/vishnu4/pen/EMBZdp?editors=1010 , but it really only seems to show just one large image that I can't zoom into to see more details. If I load it in QGIS, there are all sorts of other features that I'm not seeing.

How do I zoom into this WMTS to show the QGIS level of detail instead?

qgis image


It seems to be due to the WMTSCapabilities.xml suggesting the only matrix is at zoom level 7, which is incorrect, there is data from 7 to 17.

enter image description here

A simple workaround is to define the source as an XYZ

          source: new ol.source.XYZ({
              url: 'https://www.ngi.be/cartoweb/1.0.0/topo/default/3857/{z}/{y}/{x}.png',
              minZoom: 7,
              maxZoom: 17

Also there is no problem using .optionsFromCapabilities() with EPSG:3812

  • XYZ definitely fixes it for me, thanks! I couldn't get optionsFromCapabilities to work with 3812 though, not sure why. – Phil Mar 27 '19 at 20:38

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.