code: function(config) {
  
          // confirm required properties are supplied
          var required = {
              url: true,
              layer: true,
              style: true,
              matrixSet: true
          };
          for (var prop in required) {
              if (!(prop in config)) {
                  throw new Error("Missing property '" + prop + "' in layer configuration.");
              }
          }
  
          config.params = OpenLayers.Util.upperCaseObject(config.params);
          var args = [config.name, config.url, config.params, config];
          OpenLayers.Layer.Grid.prototype.initialize.apply(this, args);
          
  
          // determine format suffix (for REST)
          if (!this.formatSuffix) {
              this.formatSuffix = this.formatSuffixMap[this.format] || this.format.split("/").pop();            
          }
  
          // expand matrixIds (may be array of string or array of object)
          if (this.matrixIds) {
              var len = this.matrixIds.length;
              if (len && typeof this.matrixIds[0] === "string") {
                  var ids = this.matrixIds;
                  this.matrixIds = new Array(len);
                  for (var i=0; i<len; ++i) {
                      this.matrixIds[i] = {identifier: ids[i]};
                  }
              }
          }
  
      }
docs: Constructor: OpenLayers.Layer.WMTS
  Create a new WMTS layer.
  
  Example:
  (code)
  var wmts = new OpenLayers.Layer.WMTS({
  name: "My WMTS Layer",
  url: "http://example.com/wmts",
  layer: "layer_id",
  style: "default",
  matrixSet: "matrix_id"
  });
  (end)
  
  Parameters:
  config - {Object} Configuration properties for the layer.
  
  Required configuration properties:
  url - {String} The base url for the service.  See the <url> property.
  layer - {String} The layer identifier.  See the <layer> property.
  style - {String} The layer style identifier.  See the <style> property.
  matrixSet - {String} The tile matrix set identifier.  See the <matrixSet>
  property.
  
  Any other documented layer properties can be provided in the config object.