[Gvsig_english] Adding a Layer

Jorge Piera Llodrá jpiera at prodevelop.es
Fri Apr 23 08:53:01 CEST 2010


Hello Bruno.

The FLyrWCS  class has a constructor that uses a map of parameters. I 
suggest that you have a look to this constructor.

Regards,
Jorge.

Could you please sen us the log file or the messages written on your 
console?

On 04/23/2010 03:17 AM, Bruno Gomes wrote:
> Hello to all!
> Im my extension i'm trying to add a layer to a view.
> I have a method to create a wcs layer[1], this create the layer with 
> the parameters passed by me. After the layer creation, i try to add 
> the layer to a view, i do something like this:
>
> IWindow iwin = PluginServices.getMDIManager().getActiveWindow();
> MapContext mapcontext = mapControl.getMapContext();
> Map mapControl = ((View) iwin).getMapControl();
>
> FLyrWCS l = createWCSLayer(param);
> if (l != null) {
>                 l.setVisible(true);
>                 mapcontext.beginAtomicEvent();
>                 AddLayer.checkProjection(l, mapControl.getViewPort());
>                 try {
>                     mapcontext.getLayers().addLayer(l);
>                 } catch (CancelationException e) {
>                     e.printStackTrace();
>                 }
>                 mapcontext.endAtomicEvent();
>             }
>
> [1]
> public FLyrWCS createWCSLayer(Map<String,Object> parametros){
>
>         FLyrWCS layer = new FLyrWCS();
>
>         layer.setHost((String) parametros.get("Host"));
>         layer.setCoverageName((String) 
> parametros.get("CurrentCoverageName"));
>         layer.setSRS((String) parametros.get("SRS"));
>         layer.setFormat((String) parametros.get("Format"));
>         layer.setDriver((FMapWCSDriver) parametros.get("Driver"));
>         layer.setTime((String) parametros.get("Time"));
>         layer.setParameter((String) parametros.get("Parameter"));
>         layer.setName((String) parametros.get("Name"));
>         layer.setMaxResolution((Point2D) parametros.get("MaxResolution"));
>
>         return layer;
>     }
>
> The problem is that my layer appears in the view table of contents 
> (TOC), but the map not appear. What im doing wrong? Help please!!
>
> -- 
> Bruno Gomes
>
>
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at listserv.gva.es
> http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional
>    


-- 
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: jpiera at prodevelop.es
http://www.prodevelop.es
http://www.gvsig.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserv.gva.es/pipermail/gvsig_internacional/attachments/20100423/0fc2252d/attachment.htm 


More information about the Gvsig_internacional mailing list