[Gvsig_english] Refresh WMS and WFS layers

Flavio Pompermaier fla83tn at gmail.com
Thu Dec 16 20:31:59 CET 2010


Hi to all,
can comeone help me with this problem? I would like to refresh WFS and
WMS layers after a modification to underlying data in SDE. However,
the SAME code that reloads geometries in map after a pan doesn't work
when I force it after the closure of a dialog.
I also tried to call View invalidate, MapControl invalidate() and all
possible methods to make gvSIG redraw the view content.
Am I missing something?

Here's the code that I use for WMS layers for example:
  FLayers layers = mapCtrl.getMapContext().getLayers();
  mapCtrl.getMapContext().beginAtomicEvent();
  for (FLayer fLayer : visibles) {
     else if (fLayer instanceof FLyrWMS) {
           FLyrWMS wmsLayer = (FLyrWMS) fLayer;
           try {
		wmsLayer.load();
   	   }
	   catch (LoadLayerException e) {
		log.error("Error while refreshing layer " + wmsLayer.getName(), e);
	    }
      	    String infoText = traduci("refreshing_layer") + " " +
wmsLayer.getName();
 	    PluginServices.getMainFrame().getStatusBar().setInfoText(infoText);
	}
  }
  mapCtrl.getMapContext().endAtomicEvent();

For WFS layers I even have to replace the FLayer to force their
reloading...o can there be a simpler way? Using only load() o reload()
does nothing...

Best regards,
Flavio


More information about the Gvsig_internacional mailing list