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/layers/SpatialCache.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/layers/SpatialCache.java	(revision 47429)
+++ 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/layers/SpatialCache.java	(revision 47430)
@@ -187,6 +187,11 @@
     }
     
     public synchronized void refresh(String name, FeatureStore store, Envelope envelope, IProjection projection) {
+        if( store == null  
+                || envelope == null || envelope.isEmpty() || envelope.isCollapsed() 
+                || projection == null ) {
+            return;
+        }
         removeAll();
         this.refreshTask = new AbstractCancellableTask("SpatialCacheRefresh_"+name) {
             @Override
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 47429)
+++ 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 47430)
@@ -1038,7 +1038,11 @@
      * @see #reProject(ICoordTrans)
      */
     public IProjection getProjection() {
-        return getViewPort().getProjection();
+        ViewPort vp = this.getViewPort();
+        if( vp == null ) {
+            return null;
+        }
+        return vp.getProjection();
     }
 
     /**
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/BaseViewDocument.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/BaseViewDocument.java	(revision 47429)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/project/documents/view/BaseViewDocument.java	(revision 47430)
@@ -213,6 +213,9 @@
     }
 
     public IProjection getProjection() {
+        if( this.mapContext == null ) {
+            return null;
+        }
         return mapContext.getProjection();
     }
 
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/geometriespalette/GeometriesPaletteExtension.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/geometriespalette/GeometriesPaletteExtension.java	(revision 47429)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/geometriespalette/GeometriesPaletteExtension.java	(revision 47430)
@@ -5,9 +5,14 @@
 import org.apache.commons.lang3.StringUtils;
 import org.gvsig.andami.PluginServices;
 import org.gvsig.andami.plugins.Extension;
+import org.gvsig.app.ApplicationLocator;
+import org.gvsig.app.ApplicationManager;
 import org.gvsig.app.addlayer.AddLayerDialog;
 import static org.gvsig.app.extension.AddLayer.createAddLayerDialog;
 import org.gvsig.app.gui.WizardPanel;
+import org.gvsig.app.project.documents.Document;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.ViewManager;
 import org.gvsig.fmap.crs.CRSFactory;
 import org.gvsig.fmap.dal.DALLocator;
 import org.gvsig.fmap.dal.DataManager;
@@ -72,7 +77,13 @@
         final MapContext mapContext = mapContextManager.createMapContext();
         MapControl mapControl = null;
         try {
-            mapContext.setProjection(CRSFactory.getCRS("EPSG:4326"));
+            ApplicationManager application = ApplicationLocator.getApplicationManager();
+            ViewDocument view = (ViewDocument) application.getCurrentProject().getFirstDocument(ViewDocument.class);
+            if( view == null || view.getProjection()==null ) {
+                mapContext.setProjection(CRSFactory.getCRS("EPSG:4326"));
+            } else {
+                mapContext.setProjection(view.getProjection());
+            }
             mapControl = mapControlManager.createJMapControlPanel(mapContext);
             
             addLayerDialog = createAddLayerDialog(mapControl, mapContext, null);
Index: trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/geometriespalette/GeometriesPalettePanel.java
===================================================================
--- trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/geometriespalette/GeometriesPalettePanel.java	(revision 47429)
+++ trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/app/extension/geometriespalette/GeometriesPalettePanel.java	(revision 47430)
@@ -88,13 +88,17 @@
             JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
             try {
                 LabeledValue<List<Feature>> x = (LabeledValue<List<Feature>>) value;
-                if ( x!=null && x.getValue() != null && attributeLabel!=null && symbol!=null ) {
+                if ( x!=null && x.getValue() != null && symbol!=null ) {
                     Image img = drawGeometry(x.getValue());
                     label.setHorizontalAlignment(SwingConstants.CENTER);
                     label.setHorizontalTextPosition(JLabel.CENTER);
                     label.setVerticalTextPosition(JLabel.BOTTOM);
                     label.setIcon(new ImageIcon(img));
-                    label.setText(x.getLabel());
+                    if( StringUtils.isBlank(x.getLabel()) ) {
+                        label.setText("(Configure label)");
+                    } else {
+                        label.setText(x.getLabel());
+                    }
                 }
             } catch(Throwable th) {
                 label.setText("Error");
@@ -267,7 +271,7 @@
                 @Override
                 public LabeledValue<List<Feature>> get(int index) {
                     Feature feature = features.get(index);
-                    String label = "???";
+                    String label = "";
                     if( attributeLabel!=null ) {
                         label = feature.getLabelOfValue(attributeLabel.getName());
                     }
