Index: trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/MapContext.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/MapContext.java	(revision 44223)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/MapContext.java	(revision 44224)
@@ -27,10 +27,11 @@
 import java.awt.Graphics2D;
 import java.awt.geom.Rectangle2D;
 import java.awt.image.BufferedImage;
-import java.text.MessageFormat;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import org.apache.commons.lang3.ArrayUtils;
 
 import org.cresques.cts.ICoordTrans;
@@ -56,7 +57,6 @@
 import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
 import org.gvsig.fmap.mapcontext.impl.DefaultMapContextManager;
 import org.gvsig.fmap.mapcontext.layers.BaseLayerCollectionListener;
-import org.gvsig.fmap.mapcontext.layers.CancelationException;
 import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.layers.FLayers;
 import org.gvsig.fmap.mapcontext.layers.LayerCollectionEvent;
@@ -76,7 +76,6 @@
 import org.gvsig.timesupport.Instant;
 import org.gvsig.timesupport.Interval;
 import org.gvsig.timesupport.RelativeInstant;
-import org.gvsig.timesupport.Time;
 import org.gvsig.timesupport.TimeSupportLocator;
 import org.gvsig.timesupport.TimeSupportManager;
 import org.gvsig.tools.ToolsLocator;
@@ -385,7 +384,9 @@
      * @see #setGraphicsLayer(GraphicLayer)
      * @see #print(Graphics2D, double, PrintAttributes)
      */
-    private GraphicLayer tracLayer = null;
+//    private GraphicLayer tracLayer = null;
+    private static final String DEFAULT_TRACTLAYER = "Default";
+    private Map<String, GraphicLayer> tracLayers;
     //MapContextLocator.getMapContextManager().createGraphicsLayer(getProjection());
 
     /**
@@ -566,6 +567,7 @@
      */
     public MapContext(FLayers fLayers, ViewPort vp) {
         this.layers = fLayers;
+        this.tracLayers = new LinkedHashMap<>();
 
         layerEventListener = new LayerEventListener();
 
@@ -840,8 +842,10 @@
             }
         };
         this.getMapContextDrawer().print(this.layers, g, cancel, scale, properties);
-        if (tracLayer != null) {
-            tracLayer.draw(null, g, viewPort, cancel, scale);
+        for (GraphicLayer tracLayer : this.tracLayers.values()) {
+            if (tracLayer != null) {
+                tracLayer.draw(null, g, viewPort, cancel, scale);
+            }
         }
     }
 
@@ -1281,15 +1285,22 @@
     public Envelope getFullEnvelope() throws ReadException {
         Envelope envelope = layers.getFullEnvelope();
 
-        if (tracLayer != null) {
-            Envelope graphicsEnvelope = tracLayer.getFullEnvelope();
-            if (envelope == null) {
-                return graphicsEnvelope;
-            } else if (graphicsEnvelope != null) {
-                envelope.add(graphicsEnvelope);
+        for (GraphicLayer tracLayer : this.tracLayers.values()) {
+            if (tracLayer != null) {
+                Envelope graphicsEnvelope = tracLayer.getFullEnvelope();
+                if( graphicsEnvelope==null ) {
+                    continue;
+                }
+                if (envelope == null) {
+                    try {
+                        envelope =  (Envelope) graphicsEnvelope.clone();
+                    } catch (CloneNotSupportedException ex) {
+                    }
+                } else if (graphicsEnvelope != null) {
+                    envelope.add(graphicsEnvelope);
+                }
             }
         }
-
         return envelope;
     }
 
@@ -1414,6 +1425,18 @@
         layers2.addLayerCollectionListener(layerEventListener);
     }
 
+    public GraphicLayer getGraphicsLayer(String name) {
+        return this.tracLayers.get(name);
+    }
+    
+    public void setGraphicsLayer(String name, GraphicLayer layer) {
+        this.tracLayers.put(name, layer);
+    }
+    
+    public void removeGraphicsLayer(String name) {
+        this.tracLayers.remove(name);
+    }
+    
     /**
      * <p>
      * Returns the internal {@link GraphicLayer GraphicLayer}.</p>
@@ -1423,17 +1446,19 @@
      * @see #setGraphicsLayer(GraphicLayer)
      */
     public GraphicLayer getGraphicsLayer() {
+        GraphicLayer tracLayer = this.tracLayers.get(DEFAULT_TRACTLAYER);
         if (tracLayer == null) {
             if (getViewPort() != null) {
-                this.tracLayer
+                tracLayer
                         = MapContextLocator.getMapContextManager()
                         .createGraphicsLayer(
                                 getViewPort().getProjection());
             } else {
-                this.tracLayer
+                tracLayer
                         = MapContextLocator.getMapContextManager()
                         .createGraphicsLayer(null);
             }
+            this.tracLayers.put(DEFAULT_TRACTLAYER, tracLayer);
         }
         return tracLayer;
     }
@@ -1447,7 +1472,7 @@
      * @see #getGraphicsLayer()
      */
     public void setGraphicsLayer(GraphicLayer graphicLayer) {
-        tracLayer = graphicLayer;
+        this.tracLayers.put(DEFAULT_TRACTLAYER, graphicLayer);
     }
 
     /**
@@ -1706,7 +1731,9 @@
 
     protected void doDispose() throws BaseException {
         dispose(layers);
-        dispose(tracLayer);
+        for (GraphicLayer tracLayer : this.tracLayers.values()) {
+            dispose(tracLayer);
+        }
     }
 
     /**
@@ -1859,5 +1886,5 @@
             }
         };
     }
-    
+
 }
