Projection proj = theMap.getProjection();
LatLonPoint upperLeft = proj.inverse(squareUpperLeftX,
squareUpperLeftY);
LatLonPoint lowerRight = proj.inverse(squareUpperLeftX + (int)squareWidth,
squareUpperLeftY + (int)squareHeight);
LatLonPoint center = proj.inverse(squareCenterX, squareCenterY);
double necessaryScale = proj.getScale(upperLeft, lowerRight,
proj.forward(upperLeft),
proj.forward(lowerRight));
final Projection newProj = ProjectionFactory.makeProjection(Mercator.class,
(float) center.getLatitude(),