code: function(px) {
          var lonlat = px ? this.getLonLatFromPixel(px) : (
              this.getCachedCenter() || new OpenLayers.LonLat(0, 0));
          var res = this.getResolution();
          var left = lonlat.add(-res / 2, 0);
          var right = lonlat.add(res / 2, 0);
          var bottom = lonlat.add(0, -res / 2);
          var top = lonlat.add(0, res / 2);
          var dest = new OpenLayers.Projection("EPSG:4326");
          var source = this.getProjectionObject() || dest;
          if(!source.equals(dest)) {
              left.transform(source, dest);
              right.transform(source, dest);
              bottom.transform(source, dest);
              top.transform(source, dest);
          }
          
          return new OpenLayers.Size(
              OpenLayers.Util.distVincenty(left, right),
              OpenLayers.Util.distVincenty(bottom, top)
          );
      }
docs: Method: getGeodesicPixelSize
  
  Parameters:
  px - {<OpenLayers.Pixel>} The pixel to get the geodesic length for. If
  not provided, the center pixel of the map viewport will be used.
  
  Returns:
  {<OpenLayers.Size>} The geodesic size of the pixel in kilometers.