[Schmitzm-commits] r1482 - trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Feb 2 23:01:37 CET 2011
Author: alfonx
Date: 2011-02-02 23:01:37 +0100 (Wed, 02 Feb 2011)
New Revision: 1482
Modified:
trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPane.java
Log:
Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPane.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPane.java 2011-02-02 21:38:25 UTC (rev 1481)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPane.java 2011-02-02 22:01:37 UTC (rev 1482)
@@ -32,6 +32,7 @@
import javax.swing.border.Border;
import org.apache.log4j.Logger;
+import org.geotools.data.FeatureSource;
import org.geotools.data.memory.MemoryFeatureCollection;
import org.geotools.factory.GeoTools;
import org.geotools.feature.FeatureCollection;
@@ -58,8 +59,10 @@
import org.geotools.swing.JMapPane;
import org.geotools.swing.event.MapMouseEvent;
import org.geotools.swing.event.MapPaneListener;
+import org.opengis.feature.Feature;
import org.opengis.feature.simple.SimpleFeature;
import org.opengis.feature.simple.SimpleFeatureType;
+import org.opengis.feature.type.FeatureType;
import org.opengis.referencing.FactoryException;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.opengis.referencing.crs.GeographicCRS;
@@ -2734,9 +2737,12 @@
try {
if (switchCrs) {
+ final FeatureSource<? extends FeatureType, ? extends Feature> featureSource = layer
+ .getFeatureSource();
+ final CoordinateReferenceSystem coordinateReferenceSystem = featureSource
+ .getSchema().getCoordinateReferenceSystem();
getMapContext().setCoordinateReferenceSystem(
- layer.getFeatureSource().getSchema()
- .getCoordinateReferenceSystem());
+ coordinateReferenceSystem);
}
// BB umrechnen von Layer-CRS in Map-CRS
More information about the Schmitzm-commits
mailing list