Thanks for the tip, i use the constructor and works perfectly.<br><br><br><div class="gmail_quote">2010/4/23 Jorge Piera Llodrá <span dir="ltr"><<a href="mailto:jpiera@prodevelop.es">jpiera@prodevelop.es</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Hello Bruno.<br>
<br>
The FLyrWCS class has a constructor that uses a map of parameters. I
suggest that you have a look to this constructor.<br>
<br>
Regards,<br>
Jorge.<br>
<br>
Could you please sen us the log file or the messages written on your
console?<div><div></div><div class="h5"><br>
<br>
On 04/23/2010 03:17 AM, Bruno Gomes wrote:
</div></div><blockquote type="cite"><div><div></div><div class="h5">Hello to all!<br>
Im my extension i'm trying to add a layer to a view.<br>
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:<br>
<br>
IWindow iwin = PluginServices.getMDIManager().getActiveWindow();<br>
MapContext mapcontext = mapControl.getMapContext();<br>
Map mapControl = ((View) iwin).getMapControl();<br>
<br>
FLyrWCS l = createWCSLayer(param);<br>
if (l != null) {<br>
l.setVisible(true);<br>
mapcontext.beginAtomicEvent();<br>
AddLayer.checkProjection(l, mapControl.getViewPort());<br>
try {<br>
mapcontext.getLayers().addLayer(l);<br>
} catch (CancelationException e) {<br>
e.printStackTrace();<br>
}<br>
mapcontext.endAtomicEvent();<br>
}<br>
<br>
[1]<br>
public FLyrWCS createWCSLayer(Map<String,Object> parametros){<br>
<br>
FLyrWCS layer = new FLyrWCS();<br>
<br>
layer.setHost((String) parametros.get("Host"));<br>
layer.setCoverageName((String)
parametros.get("CurrentCoverageName"));<br>
layer.setSRS((String) parametros.get("SRS"));<br>
layer.setFormat((String) parametros.get("Format"));<br>
layer.setDriver((FMapWCSDriver) parametros.get("Driver"));<br>
layer.setTime((String) parametros.get("Time"));<br>
layer.setParameter((String) parametros.get("Parameter"));<br>
layer.setName((String) parametros.get("Name"));<br>
layer.setMaxResolution((Point2D)
parametros.get("MaxResolution"));<br>
<br>
return layer;<br>
}<br>
<br>
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!! <br>
<br>
-- <br>
Bruno Gomes<br>
</div></div><pre><fieldset></fieldset>
_______________________________________________
Gvsig_internacional mailing list
<a href="mailto:Gvsig_internacional@listserv.gva.es" target="_blank">Gvsig_internacional@listserv.gva.es</a>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a>
</pre>
</blockquote>
<br>
<br>
<pre cols="72">--
Jorge Piera Llodrá
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: <a href="mailto:jpiera@prodevelop.es" target="_blank">jpiera@prodevelop.es</a>
<a href="http://www.prodevelop.es" target="_blank">http://www.prodevelop.es</a>
<a href="http://www.gvsig.org" target="_blank">http://www.gvsig.org</a>
</pre>
</div>
<br>_______________________________________________<br>
Gvsig_internacional mailing list<br>
<a href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a><br>
<a href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional" target="_blank">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Bruno Gomes<br>