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
Comment #1
patrickbrosi commentedComment #2
patrickbrosi commentedComment #3
patrickbrosi commentedComment #4
patrickbrosi commentedI 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.
Comment #5
friedjoff commentedLooks good. The only things I would change (also see attached patch):
Comment #6
patrickbrosi commentedI 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).
Comment #7
friedjoff commentedLooks good.
Comment #8
polComment #10
polThanks guys, committed !