Revision 8801 org.gvsig.raster/branches/org.gvsig.raster.2.4/org.gvsig.wmts/org.gvsig.wmts.app/org.gvsig.wmts.app.mainplugin/src/main/java/org/gvsig/wmts/app/mainplugin/WMTSAddLayerPanel.java
WMTSAddLayerPanel.java | ||
---|---|---|
113 | 113 |
final MapContext mapContext = this.getMapContext(); |
114 | 114 |
|
115 | 115 |
final WMTSLayerNode node = this.panel.getParameters(); |
116 |
final boolean refreshLocalCache = this.panel.refreshLocalCache(); |
|
116 | 117 |
Thread task = new Thread(new Runnable() { |
117 | 118 |
|
118 | 119 |
@Override |
119 | 120 |
public void run() { |
120 |
FLayer layer = createSingleLayer(node.getTitle(), node.getParameters()); |
|
121 |
FLayer layer = createSingleLayer(node.getTitle(), node.getParameters(), refreshLocalCache);
|
|
121 | 122 |
getMapCtrl().addLayer(layer); |
122 | 123 |
mapContext.invalidate(); |
123 | 124 |
} |
... | ... | |
127 | 128 |
|
128 | 129 |
} |
129 | 130 |
|
130 |
private FLayer createSingleLayer(final String layerName, final DataStoreParameters parameters) { |
|
131 |
private FLayer createSingleLayer(final String layerName, final DataStoreParameters parameters, boolean refreshLocalCache) {
|
|
131 | 132 |
final MapContextManager manager = MapContextLocator.getMapContextManager(); |
132 | 133 |
|
133 | 134 |
logger.info("addLayer('{}',...)", layerName); |
... | ... | |
147 | 148 |
|
148 | 149 |
try { |
149 | 150 |
store.useCache("TileCache", tileParameters); |
150 |
RasterCache cache = store.getCache(); |
|
151 |
cache.deleteAll(); |
|
151 |
if (refreshLocalCache) { |
|
152 |
RasterCache cache = store.getCache(); |
|
153 |
cache.deleteAll(); |
|
154 |
} |
|
152 | 155 |
} catch (DataException e) { |
153 | 156 |
logger.warn("Can't cache the layer.", e); |
154 | 157 |
} |
Also available in: Unified diff