Index: 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionLineRenderableLayer.java
===================================================================
--- 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionLineRenderableLayer.java	(revision 771)
+++ 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionLineRenderableLayer.java	(revision 772)
@@ -40,8 +40,7 @@
 
     public DefaultVectorExtrusionLineRenderableLayer(VectorLoaderParameters parameters, FeatureStore featureStore,
         IVectorLegend legend) {
-        super(parameters, featureStore);
-        this.normalShapeAttributes = getNormalShapAttributes(legend);
+        super(parameters, featureStore, legend);
     }
 
     @Override
@@ -91,12 +90,16 @@
         List<Position> verticesList = getVertices(curve, h, hasZ, coordTrans);
         Path path = new Path(verticesList);
         path.setAltitudeMode(getAltitudeMode(this.parameters.getVectorElevationMode()));
-        path.setAttributes(normalShapeAttributes);
+        path.setAttributes(getNormalShapAttributes(legend));
         path.setExtrude(true);
         return path;
     }
 
     private BasicShapeAttributes getNormalShapAttributes(IVectorLegend legend) {
+        
+        if(normalShapeAttributes != null) {
+            return this.normalShapeAttributes;
+        }
 
         Material outlineMaterial;
         double outlineOpacity = 1.0;
@@ -133,4 +136,9 @@
         return featureQuery;
     }
 
+    @Override
+    protected void clearRenderAttributes() {
+        // Sets normal shape attributes to null to force create it again
+        this.normalShapeAttributes = null;
+    }
 }
Index: 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionPolygonRenderableLayer.java
===================================================================
--- 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionPolygonRenderableLayer.java	(revision 771)
+++ 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionPolygonRenderableLayer.java	(revision 772)
@@ -17,7 +17,6 @@
 import org.gvsig.fmap.geom.primitive.Point;
 import org.gvsig.fmap.geom.primitive.Polygon;
 import org.gvsig.fmap.geom.primitive.Ring;
-import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend;
 import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol;
@@ -40,9 +39,7 @@
 
     public DefaultVectorExtrusionPolygonRenderableLayer(VectorLoaderParameters parameters, FeatureStore featureStore,
         IVectorLegend legend) {
-        super(parameters, featureStore);
-        this.normalShapeAttributes = getNormalShapeAttributes(legend);
-        this.sideShapeAttributes = getSideShapeAttributes(legend);
+        super(parameters, featureStore, legend);
     }
 
     @Override
@@ -111,8 +108,8 @@
             renderable.addInnerBoundary(getInteriorRing(polygon.getInteriorRing(i), hasZ, h));
         }
         renderable.setAltitudeMode(getAltitudeMode(this.parameters.getVectorElevationMode()));
-        renderable.setAttributes(normalShapeAttributes);
-        renderable.setSideAttributes(sideShapeAttributes);
+        renderable.setAttributes(getNormalShapeAttributes(legend));
+        renderable.setSideAttributes(getSideShapeAttributes(legend));
         return renderable;
     }
 
@@ -132,6 +129,11 @@
     }
 
     private BasicShapeAttributes getSideShapeAttributes(IVectorLegend legend) {
+        
+        if(this.sideShapeAttributes != null) {
+            return this.sideShapeAttributes;
+        }
+        
         Material sideFillMaterial = Material.GRAY;
         double fillOpacity = 0.7;
 
@@ -147,13 +149,18 @@
             sideFillMaterial = new Material(this.parameters.getDefaultColor());
             fillOpacity = 0.7;
         }
-        BasicShapeAttributes attr = new BasicShapeAttributes();
-        attr.setInteriorMaterial(sideFillMaterial);
-        attr.setInteriorOpacity(fillOpacity);
-        return attr;
+        sideShapeAttributes = new BasicShapeAttributes();
+        sideShapeAttributes.setInteriorMaterial(sideFillMaterial);
+        sideShapeAttributes.setInteriorOpacity(fillOpacity);
+        return sideShapeAttributes;
     }
 
     private BasicShapeAttributes getNormalShapeAttributes(IVectorLegend legend) {
+        
+        if(this.normalShapeAttributes != null) {
+            return this.normalShapeAttributes;
+        }
+        
         Material fillMaterial = Material.LIGHT_GRAY;
         Material outlineMaterial = Material.BLACK;
         double fillOpacity = 0.7;
@@ -176,12 +183,12 @@
             fillOpacity = 0.7;
             outlineWidth = 2;
         }
-        BasicShapeAttributes attr = new BasicShapeAttributes();
-        attr.setInteriorMaterial(fillMaterial);
-        attr.setInteriorOpacity(fillOpacity);
-        attr.setOutlineMaterial(outlineMaterial);
-        attr.setOutlineWidth(outlineWidth);
-        return attr;
+        normalShapeAttributes = new BasicShapeAttributes();
+        normalShapeAttributes.setInteriorMaterial(fillMaterial);
+        normalShapeAttributes.setInteriorOpacity(fillOpacity);
+        normalShapeAttributes.setOutlineMaterial(outlineMaterial);
+        normalShapeAttributes.setOutlineWidth(outlineWidth);
+        return normalShapeAttributes;
     }
 
     /**
@@ -196,8 +203,13 @@
         int r = color.getRed();
         int g = color.getGreen();
         int b = color.getBlue();
-        Color sideFillColor = new Color(Math.max((int) (r * factor), 0), Math.max((int) (g * factor), 0),
+        return new Color(Math.max((int) (r * factor), 0), Math.max((int) (g * factor), 0),
             Math.max((int) (b * factor), 0));
-        return sideFillColor;
     }
+
+    @Override
+    protected void clearRenderAttributes() {
+        this.normalShapeAttributes = null;
+        this.sideShapeAttributes = null;
+    }
 }
Index: 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionPointRenderableLayer.java
===================================================================
--- 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionPointRenderableLayer.java	(revision 771)
+++ 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/extrusion/DefaultVectorExtrusionPointRenderableLayer.java	(revision 772)
@@ -11,7 +11,6 @@
 import org.gvsig.fmap.dal.feature.Feature;
 import org.gvsig.fmap.dal.feature.FeatureQuery;
 import org.gvsig.fmap.dal.feature.FeatureStore;
-import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.Geometry.TYPES;
 import org.gvsig.fmap.geom.aggregate.MultiPoint;
@@ -35,8 +34,7 @@
 
     public DefaultVectorExtrusionPointRenderableLayer(VectorExtrusionLoaderParameters parameters, FeatureStore featureStore,
         IVectorLegend legend) {
-        super(parameters, featureStore);
-        this.markAttributes = getBasicMarkerAttributes(legend);
+        super(parameters, featureStore, legend);
     }
 
     @Override
@@ -95,7 +93,7 @@
         }
         marker.setAltitudeMode(getAltitudeMode(parameters.getVectorElevationMode()));
         marker.setLineEnabled(true);
-        marker.setAttributes(this.markAttributes);
+        marker.setAttributes(this.getBasicMarkerAttributes(legend));
         return marker;
     }
 
@@ -144,4 +142,9 @@
         return markAttributes;
     }
 
+    @Override
+    protected void clearRenderAttributes() {
+        this.markAttributes = null;
+    }
+
 }
Index: 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorLineRenderableLayer.java
===================================================================
--- 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorLineRenderableLayer.java	(revision 771)
+++ 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorLineRenderableLayer.java	(revision 772)
@@ -13,8 +13,6 @@
 import org.gvsig.fmap.geom.aggregate.MultiLine;
 import org.gvsig.fmap.geom.primitive.Curve;
 import org.gvsig.fmap.geom.primitive.Line;
-import org.gvsig.fmap.geom.primitive.Point;
-import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend;
 import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
@@ -34,8 +32,7 @@
 
     public DefaultVectorLineRenderableLayer(VectorLoaderParameters parameters, FeatureStore featureStore,
         IVectorLegend legend) {
-        super(parameters, featureStore);
-        this.normalShapeAttributes = getNormalShapAttributes(legend);
+        super(parameters, featureStore, legend);
     }
 
     @Override
@@ -76,11 +73,15 @@
         List<Position> verticesList = getVertices(curve, h, hasZ, coordTrans);
         Path path = new Path(verticesList);
         path.setAltitudeMode(getAltitudeMode(this.parameters.getVectorElevationMode()));
-        path.setAttributes(normalShapeAttributes);
+        path.setAttributes(getNormalShapAttributes(legend));
         return path;
     }
 
     private BasicShapeAttributes getNormalShapAttributes(IVectorLegend legend) {
+        
+        if(this.normalShapeAttributes != null) {
+            return normalShapeAttributes;
+        }
 
         Material outlineMaterial;
         double outlineOpacity = 1.0;
@@ -105,4 +106,9 @@
         normalShapeAttributes.setOutlineOpacity(outlineOpacity);
         return normalShapeAttributes;
     }
+
+    @Override
+    protected void clearRenderAttributes() {
+        this.normalShapeAttributes = null;
+    }
 }
Index: 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorPolygonRenderableLayer.java
===================================================================
--- 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorPolygonRenderableLayer.java	(revision 771)
+++ 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorPolygonRenderableLayer.java	(revision 772)
@@ -14,7 +14,6 @@
 import org.gvsig.fmap.geom.primitive.Point;
 import org.gvsig.fmap.geom.primitive.Polygon;
 import org.gvsig.fmap.geom.primitive.Ring;
-import org.gvsig.fmap.mapcontext.layers.FLayer;
 import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend;
 import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
 import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol;
@@ -34,8 +33,7 @@
 
     public DefaultVectorPolygonRenderableLayer(VectorLoaderParameters parameters, FeatureStore featureStore,
         IVectorLegend legend) {
-        super(parameters, featureStore);
-        this.normalShapeAttributes = getNormalBasicShapeAttributes(legend);
+        super(parameters, featureStore, legend);
     }
 
     @Override
@@ -84,7 +82,7 @@
             renderable.addInnerBoundary(getInteriorRing(polygon.getInteriorRing(i), hasZ, h));
         }
         renderable.setAltitudeMode(getAltitudeMode(this.parameters.getVectorElevationMode()));
-        renderable.setAttributes(normalShapeAttributes);
+        renderable.setAttributes(getNormalBasicShapeAttributes(legend));
         return renderable;
     }
 
@@ -104,6 +102,10 @@
     }
 
     private BasicShapeAttributes getNormalBasicShapeAttributes(IVectorLegend legend) {
+        
+        if(normalShapeAttributes != null) {
+            return this.normalShapeAttributes;
+        }
 
         Material fillMaterial = Material.LIGHT_GRAY;
         Material outlineMaterial = Material.BLACK;
@@ -127,11 +129,17 @@
             fillOpacity = 0.7;
             outlineWidth = 2;
         }
-        BasicShapeAttributes attr = new BasicShapeAttributes();
-        attr.setInteriorMaterial(fillMaterial);
-        attr.setInteriorOpacity(fillOpacity);
-        attr.setOutlineMaterial(outlineMaterial);
-        attr.setOutlineWidth(outlineWidth);
-        return attr;
+        normalShapeAttributes = new BasicShapeAttributes();
+        normalShapeAttributes.setInteriorMaterial(fillMaterial);
+        normalShapeAttributes.setInteriorOpacity(fillOpacity);
+        normalShapeAttributes.setOutlineMaterial(outlineMaterial);
+        normalShapeAttributes.setOutlineWidth(outlineWidth);
+        return normalShapeAttributes;
     }
+
+    @Override
+    protected void clearRenderAttributes() {
+        // Sets normal shape attributes to null to force create it again
+        this.normalShapeAttributes = null;
+    }
 }
Index: 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorPointRenderableLayer.java
===================================================================
--- 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorPointRenderableLayer.java	(revision 771)
+++ 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/vector/DefaultVectorPointRenderableLayer.java	(revision 772)
@@ -6,11 +6,8 @@
 
 import org.cresques.cts.ICoordTrans;
 
-import org.gvsig.fmap.dal.exception.DataException;
 import org.gvsig.fmap.dal.feature.Feature;
-import org.gvsig.fmap.dal.feature.FeatureQuery;
 import org.gvsig.fmap.dal.feature.FeatureStore;
-import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.Geometry.TYPES;
 import org.gvsig.fmap.geom.aggregate.MultiPoint;
@@ -34,8 +31,7 @@
 
     public DefaultVectorPointRenderableLayer(VectorLoaderParameters parameters, FeatureStore featureStore,
         IVectorLegend legend) {
-        super(parameters, featureStore);
-        this.markAttributes = getBasicMarkerAttributes(legend);
+        super(parameters, featureStore, legend);
     }
 
     @Override
@@ -86,7 +82,7 @@
             marker = new PointPlacemark(position);
         }
         marker.setAltitudeMode(getAltitudeMode(parameters.getVectorElevationMode()));
-        marker.setAttributes(this.markAttributes);
+        marker.setAttributes(getBasicMarkerAttributes(super.legend));
         return marker;
     }
 
@@ -124,4 +120,9 @@
         return markAttributes;
     }
 
+    @Override
+    protected void clearRenderAttributes() {
+        this.markAttributes = null;
+    }
+
 }
Index: 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/AbstractRenderableLayer.java
===================================================================
--- 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/AbstractRenderableLayer.java	(revision 771)
+++ 2.1/trunk/org.gvsig.view3d/org.gvsig.view3d.vector/org.gvsig.view3d.vector.lib/org.gvsig.view3d.vector.lib.impl/src/main/java/org/gvsig/view3d/vector/lib/impl/AbstractRenderableLayer.java	(revision 772)
@@ -19,6 +19,7 @@
 import org.gvsig.fmap.dal.feature.FeatureType;
 import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
 import org.gvsig.fmap.geom.primitive.Point;
+import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend;
 import org.gvsig.tools.dispose.DisposableIterator;
 import org.gvsig.view3d.vector.lib.api.VectorElevationMode;
 import org.gvsig.view3d.vector.lib.api.VectorLoaderParameters;
@@ -33,19 +34,20 @@
     private static final Logger LOG = LoggerFactory.getLogger(AbstractRenderableLayer.class);
 
     protected FeatureStore featureStore;
+    protected IVectorLegend legend;
 
     protected VectorLoaderParameters parameters;
 
-    public AbstractRenderableLayer(VectorLoaderParameters parameters, FeatureStore featureStore) {
+    public AbstractRenderableLayer(VectorLoaderParameters parameters, FeatureStore featureStore, IVectorLegend legend) {
         this.featureStore = featureStore;
+        this.legend = legend;
         this.parameters = parameters;
+        addRenderableObjects();
+    }
+    
+    protected void addRenderableObjects() {
         ExecutorService executor = Executors.newSingleThreadExecutor();
-        executor.execute(addRenderableObjects());
-    }
-
-    protected Runnable addRenderableObjects() {
-        
-        return new Runnable() {
+        executor.execute( new Runnable() {
             
             @Override
             public void run() {
@@ -83,7 +85,7 @@
                     }
                 }
             }
-        };
+        });
     }
 
     protected int getAltitudeMode(VectorElevationMode mode) {
@@ -138,6 +140,35 @@
         IProjection destProj = CRSFactory.getCRS("EPSG:4326");
         return origProj.getCT(destProj);
     }
+    
+    @Override
+    public void setExpiryTime(long expiryTime) {
+        // If expiry time is greater than last expiry time, reload 
+        // renderables
+        if (expiryTime > this.getExpiryTime()) {
+            reloadRenderables();
+        }
+        super.setExpiryTime(expiryTime);
+    }
 
+    protected void reloadRenderables() {
+        // Clear renderables
+        clearRenderables();
+        // Clear render attibutes
+        clearRenderAttributes();
+        // Reload renderables
+        addRenderableObjects();
+    }
+    
+    /**
+     * 
+     */
+    protected abstract void clearRenderAttributes();
+    
+    /**
+     * 
+     * @param feature
+     * @return
+     */
     protected abstract List<Renderable> getRenderables(Feature feature);
 }
