code: function(bounds, origin, resolution) {
          var tilelon = resolution*this.tileSize.w;
          var tilelat = resolution*this.tileSize.h;
          
          var offsetlon = bounds.left;
          var tilecol = Math.floor(offsetlon/tilelon) - this.buffer;
          
          var offsetlat = bounds.top;  
          var tilerow = Math.floor(offsetlat/tilelat) + this.buffer;
          
          return { 
            tilelon: tilelon, tilelat: tilelat,
            startcol: tilecol, startrow: tilerow
          };
      }
docs: Method: calculateGridLayout
  ka-Map uses the center point of the map as an origin for
  its tiles. Override calculateGridLayout to center tiles
  correctly for this case.
  
  Parameters:
  bounds - {<OpenLayers.Bound>}
  origin - {<OpenLayers.LonLat>}
  resolution - {Number}
  
  Returns:
  {Object} Object containing properties tilelon, tilelat, startcol,
  startrow