[Gvsig_english] Refresh WMS and WFS layers

Nacho Uve nachouve at gmail.com
Sat Feb 12 20:42:48 CET 2011


Flavio, are you solved this problem?


2010/12/16 Flavio Pompermaier <fla83tn at gmail.com>

> 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
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20110212/f78c5c2f/attachment.htm 


More information about the Gvsig_internacional mailing list