Revision 1417

View differences:

trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLyrDefault.java
48 48

  
49 49
import org.cresques.cts.ICoordTrans;
50 50
import org.cresques.cts.IProjection;
51
import org.cresques.cts.ProjectionPool;
51 52

  
52 53
import java.beans.PropertyChangeSupport;
53 54

  
......
203 204
		xml.putProperty("maxScale",maxScale);
204 205
		
205 206
		//TODO xml.addChild(parentLayer.getXMLEntity());
206
		//TODO xml.addChild(projection.getXMLEntity());
207 207
		xml.putProperty("visible", visible);
208
		if (projection != null) {
209
			xml.putProperty("proj", projection.getAbrev());
210
		}
208 211

  
209 212
		return xml;
210 213
	}
......
223 226
		active = xml.getBooleanProperty("active");
224 227
		name = xml.getStringProperty("name");
225 228
		minScale=xml.getDoubleProperty("minScale");
226
		maxScale=xml.getDoubleProperty("maxScale");
229
		maxScale=xml.getDoubleProperty("maxScale");		
227 230
		visible = xml.getBooleanProperty("visible");
231
		if (xml.contains("proj")) {
232
			setProjection(ProjectionPool.get(xml.getStringProperty("proj")));
233
		}
234
		
228 235
	}
229 236

  
230 237
	/**
trunk/libraries/libFMap/src/com/iver/cit/gvsig/fmap/layers/FLayers.java
53 53
import com.iver.utiles.XMLEntity;
54 54

  
55 55
import org.cresques.cts.ICoordTrans;
56
import org.cresques.cts.IProjection;
57
import org.cresques.cts.gt2.CoordSys;
58
import org.cresques.cts.gt2.CoordTrans;
56 59

  
57 60
import java.awt.Graphics2D;
58 61
import java.awt.geom.Rectangle2D;
......
67 70
import java.util.BitSet;
68 71
import java.util.Iterator;
69 72

  
73
import javax.swing.JOptionPane;
70 74

  
75

  
71 76
/**
72 77
 * Representa un nodo interno en el ?rbol de capas
73 78
 */
......
464 469
									xml.getChild(i).getStringProperty("driverName"),
465 470
									new File(xml.getChild(i).getStringProperty("file")),
466 471
									this.getFMap().getViewPort().getProjection());
472
														    
467 473
					} else if (true) {
468 474
						//TODO falta por implementar
469 475
					} else if (true) {
......
471 477
					}
472 478
	
473 479
					layer.setXMLEntity(xml.getChild(i));
480
					// Comprobar que la proyecci?n es la misma que la de FMap
481
					// Si no lo es, es una capa que est? reproyectada al vuelo 
482
					IProjection proj = layer.getProjection();
483
					if (proj != null)
484
					    if (proj != fmap.getProjection())
485
					    {
486
							ICoordTrans ct = new CoordTrans((CoordSys) proj,
487
									(CoordSys) fmap.getProjection());
488
							layer.setCoordTrans(ct);
489
							System.err.println("coordTrans = " +
490
								proj.getAbrev() + " " +
491
								fmap.getProjection().getAbrev());
492
					    }
493
					
474 494
				} else if (className.equals(FLyrWMS.class.getName())) {
475 495
					try {
476 496
						layer = LayerFactory.createLayer(s[i],

Also available in: Unified diff