public void naturalZoom(double x,double y,double factor){
  double rangeX=Math.abs(currentExtent.getMaxX() - currentExtent.getMinX());
  double rangeY=Math.abs(currentExtent.getMaxY() - currentExtent.getMinY());
  double relativePositionX=Math.abs(x - currentExtent.getMinX()) / rangeX;
  double relativePositionY=Math.abs(y - currentExtent.getMinY()) / rangeY;
  double newXRange=rangeX * factor;
  double newYRange=rangeY * factor;
  currentExtent.setMinX(x - newXRange * relativePositionX);
  currentExtent.setMinY(y - newYRange * relativePositionY);
  currentExtent.setMaxX(x + newXRange * (1.0 - relativePositionX));
  currentExtent.setMaxY(y + newYRange * (1.0 - relativePositionY));
  addToExtentHistory(currentExtent);
}

public void naturalZoom ( double x , double y , double factor ) { double rangeX = Math . abs ( currentExtent . getMaxX ( ) - currentExtent . getMinX ( ) ) ; double rangeY = Math . abs ( currentExtent . getMaxY ( ) - currentExtent . getMinY ( ) ) ; double relativePositionX = Math . abs ( x - currentExtent . getMinX ( ) ) / rangeX ; double relativePositionY = Math . abs ( y - currentExtent . getMinY ( ) ) / rangeY ; double newXRange = rangeX * factor ; double newYRange = rangeY * factor ; currentExtent . setMinX ( x - newXRange * relativePositionX ) ; currentExtent . setMinY ( y - newYRange * relativePositionY ) ; currentExtent . setMaxX ( x + newXRange * ( 1.0 - relativePositionX ) ) ; currentExtent . setMaxY ( y + newYRange * ( 1.0 - relativePositionY ) ) ; addToExtentHistory ( currentExtent ) ; }
performs a zoom based on a point but does not re - center the extent .
