code: function(boundsOnly) {
          var onScreen = false;
          if(this.layer && this.layer.map) {
              var screenBounds = this.layer.map.getExtent();
              if(boundsOnly) {
                  var featureBounds = this.geometry.getBounds();
                  onScreen = screenBounds.intersectsBounds(featureBounds);
              } else {
                  var screenPoly = screenBounds.toGeometry();
                  onScreen = screenPoly.intersects(this.geometry);
              }
          }    
          return onScreen;
      }
docs: Method: onScreen
  Determine whether the feature is within the map viewport.  This method
  tests for an intersection between the geometry and the viewport
  bounds.  If a more effecient but less precise geometry bounds
  intersection is desired, call the method with the boundsOnly
  parameter true.
  
  Parameters:
  boundsOnly - {Boolean} Only test whether a feature's bounds intersects
  the viewport bounds.  Default is false.  If false, the feature's
  geometry must intersect the viewport for onScreen to return true.
  
  Returns:
  {Boolean} The feature is currently visible on screen (optionally
  based on its bounds if boundsOnly is true).