code: function(loc) {
          var res = this.getServerResolution();
          
          var fx = (loc.lon - this.tileOrigin.lon) / (res * this.tileSize.w);
          var fy = (this.tileOrigin.lat - loc.lat) / (res * this.tileSize.h);
  
          var col = Math.floor(fx);
          var row = Math.floor(fy);
          
          return {
              col: col, 
              row: row,
              i: Math.floor((fx - col) * this.tileSize.w),
              j: Math.floor((fy - row) * this.tileSize.h)
          };
      }
docs: Method: getTileInfo
  Get tile information for a given location at the current map resolution.
  
  Parameters:
  loc - {<OpenLayers.LonLat} A location in map coordinates.
  
  Returns:
  {Object} An object with "col", "row", "i", and "j" properties.  The col
  and row values are zero based tile indexes from the top left.  The
  i and j values are the number of pixels to the left and top
  (respectively) of the given location within the target tile.