double dist = 0.01 * proj.getDefaultZoomInPPD();
LatLon ll1 = proj.eastNorth2latlon(new EastNorth(center.east() - dist, center.north()));
LatLon ll2 = proj.eastNorth2latlon(new EastNorth(center.east() + dist, center.north()));
double meterPerEasting = ll1.greatCircleDistance(ll2) / dist / 2;
double scale = meterPerPixel / meterPerEasting; // unit: easting per pixel
viewport = new ViewportData(center, scale);
} catch (NumberFormatException ex) {
Main.warn(ex);
}
}
}