code: function(bounds) {
          var res = this.getServerResolution();
          var x = Math.round((bounds.left - this.maxExtent.left) /
              (res * this.tileSize.w));
          var y = Math.round((this.maxExtent.top - bounds.top) /
              (res * this.tileSize.h));
          var z = this.getServerZoom();
  
          if (this.wrapDateLine) {
              var limit = Math.pow(2, z);
              x = ((x % limit) + limit) % limit;
          }
  
          return {'x': x, 'y': y, 'z': z};
      }
docs: Method: getXYZ
  Calculates x, y and z for the given bounds.
  
  Parameters:
  bounds - {<OpenLayers.Bounds>}
  
  Returns:
  {Object} - an object with x, y and z properties.