code: function (viewPortPx) {
          var lonlat = null;
          var map = this.map;
          if (viewPortPx != null && map.minPx) {
              var res = map.getResolution();
              var maxExtent = map.getMaxExtent({restricted: true});
              var lon = (viewPortPx.x - map.minPx.x) * res + maxExtent.left;
              var lat = (map.minPx.y - viewPortPx.y) * res + maxExtent.top;
              lonlat = new OpenLayers.LonLat(lon, lat);
  
              if (this.wrapDateLine) {
                  lonlat = lonlat.wrapDateLine(this.maxExtent);
              }
          }
          return lonlat;
      }
docs: APIMethod: getLonLatFromViewPortPx
  
  Parameters:
  viewPortPx - {<OpenLayers.Pixel>|Object} An OpenLayers.Pixel or
  an object with a 'x'
  and 'y' properties.
  
  Returns:
  {<OpenLayers.LonLat>} An OpenLayers.LonLat which is the passed-in
  view port <OpenLayers.Pixel>, translated into lon/lat by the layer.