+ CoordinateReferenceSystem crs = mapPane.getMapContext()
+ .getCoordinateReferenceSystem();
+
+ ReferencedEnvelope toDisplay;
+ if (crs != null)
+ try {
+ toDisplay = areaOfInterest.transform(crs, true);
+ } catch (Exception e) {
+ throw new ArgeoException("Cannot reproject " + areaOfInterest,
+ e);
+ }
+ else
+ toDisplay = areaOfInterest;
+ mapPane.setDisplayArea(toDisplay);
+ }
+
+ public void setCoordinateReferenceSystem(String crs) {
+ try {
+ CoordinateReferenceSystem crsObj = CRS.decode(crs);
+ mapPane.getMapContext().setCoordinateReferenceSystem(crsObj);
+ mapPane.repaint();
+ } catch (Exception e) {
+ throw new ArgeoException("Cannot set CRS '" + crs + "'", e);
+ }
+