[mapserver-dev] mapcache WMTS: offset on some zoom levels

Mathias Walker mwa at sourcepole.ch
Thu Sep 29 05:48:44 EDT 2011


While setting up a mapcache WMTS for EPSG:21781 I noticed that the tile data 
on some zoom levels is offset to the reference data when loading it with 
OpenLayers. If I load the same layer as mapcache TMS all zoom levels are 
correctly aligned.
Am I missing some configuration options or are there some issues in the WMTS 

OpenLayers uses the same extent and resolutions as the mapcache config.
The following zoom levels are offset for WMTS in my setup:
(0 - 6 unknown) 7, 8, 9, 10, 12, 13, 14, 15, 17, 19, 24

Here are my settings:
mapcache.xml grid:

  <grid name="CH1903">
      <title>CH1903 / LV03</title>
    <size>256 256</size>


  var options = {
    controls: [],
    projection: new OpenLayers.Projection("EPSG:21781"),
    units: "m",
    maxExtent:  new OpenLayers.Bounds.fromArray([420000,30000,900000,350000]),
    restrictedExtent:  new 
    allOverlays: false
  var map = new OpenLayers.Map("map", options);

  map.addLayer( new OpenLayers.Layer.WMTS({
      name: "Bezirksgrenzen WMTS",
      url: "http://???.sourcepole.ch/mapcache/wmts/",
      layer: 'bezirksgrenzen',
      matrixSet: 'CH1903',
      format: 'image/png',
      style: 'default',
      maxExtent: new OpenLayers.Bounds(420000,30000,900000,350000)

  map.addLayer( new OpenLayers.Layer.TMS(
    "Bezirksgrenzen TMS",
      layername: "bezirksgrenzen",
      type: "png",
      isBaseLayer: false,
      buffer: 0,
      visibility: true

Best regards
Mathias Walker
Sourcepole - Linux & Open Source Solutions
Churerstrasse 22, 8808 Pfäffikon SZ, Switzerland
Tel: 044 440 77 11  Fax: 044 440 77 12
mwa at sourcepole.ch  http://www.sourcepole.ch

More information about the mapserver-dev mailing list