In plugins/layer_types/openlayers_layer_type_wmts.js, the WMTS layer automatically provides a matrixId array which is filled with 26 matrixIDs consisting of the current options.matrixSet and an integer (the zoom level).

var matrixIds = new Array(26);
for (var i=0; i<26; ++i) {
  matrixIds[i] = options.matrixSet + ":" + i;
}

I don't think this behaviour is correct. It only applies to GeoServer WMTS services, which expect the matrixId to be prefixed by the matrixSet and a colon. The default behaviour of OpenLayers is to set the matrixId to the current zoom level (http://dev.openlayers.org/docs/files/OpenLayers/Layer/WMTS-js.html#OpenL...). It only uses other matrixIds if they are provided explicitely. Wouldn't it be better if this behaviour was implemented in openlayers_layer_type_wmts.js as well? The current setting makes it impossible to use WMTS servers that expect the standard behaviour of OpenLayers. I think there should be an additional field 'matrix-Ids' for the layer type WMTS in which the user can set the matrix Ids by himself as a comma separated list. An additional checkbox "Prefix with matrixSet" could be provided which implements the current behaviour.

Comments

patrickbrosi’s picture

Title: matrixIds always prefixed by projection string » matrixIds always prefixed by matrixSet
patrickbrosi’s picture

Title: matrixIds always prefixed by matrixSet » matrixIds always prefixed by matrixSet in WMTS layer
patrickbrosi’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
patrickbrosi’s picture

I created a patch for 2.x-dev which adds the behaviour described above to WMTS layers. Matrix IDs can either be specified explicitly via a comma separated list or auto-generated. Auto-generation results in matrixIds per zoom level, pre-fixed with the current matrixSet. If no matrix IDs are given, it falls back to the OL2 standard behaviour, which is matrixId = zoom level.

friedjoff’s picture

Status: Active » Needs review
StatusFileSize
new3.6 KB

Looks good. The only things I would change (also see attached patch):

  • activate matrixIdsAuto by default to maintain the same default behavior
  • hide the matrixIds field if matrixIdsAuto is active to reduce confusion
patrickbrosi’s picture

I tested friedjoffs changes and everything looks good. Some minor improvement: user-defined matrix IDs should be stripped off whitespaces before storing them (updated patch attached).

friedjoff’s picture

Status: Needs review » Reviewed & tested by the community

Looks good.

pol’s picture

Assigned: Unassigned » pol

  • Pol committed ccee1d3 on authored by patrickbrosi
    Issue #2275917 by patrickbrosi: matrixIds always prefixed by matrixSet...
pol’s picture

Status: Reviewed & tested by the community » Fixed

Thanks guys, committed !

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.