<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hello Bruno.<br>
<br>
The FLyrWCS&nbsp; 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?<br>
<br>
On 04/23/2010 03:17 AM, Bruno Gomes wrote:
<blockquote
 cite="mid:h2p68b9e2081004221817m9f08db3at7ab98ae4c7b52b0@mail.gmail.com"
 type="cite">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>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; l.setVisible(true);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapcontext.beginAtomicEvent();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; AddLayer.checkProjection(l, mapControl.getViewPort());<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapcontext.getLayers().addLayer(l);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (CancelationException e) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; e.printStackTrace();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mapcontext.endAtomicEvent();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
  <br>
[1]<br>
public FLyrWCS createWCSLayer(Map&lt;String,Object&gt; parametros){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; FLyrWCS layer = new FLyrWCS();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setHost((String) parametros.get("Host"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setCoverageName((String)
parametros.get("CurrentCoverageName"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setSRS((String) parametros.get("SRS"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setFormat((String) parametros.get("Format"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setDriver((FMapWCSDriver) parametros.get("Driver"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setTime((String) parametros.get("Time"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setParameter((String) parametros.get("Parameter"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setName((String) parametros.get("Name"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; layer.setMaxResolution((Point2D)
parametros.get("MaxResolution"));<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return layer;<br>
&nbsp;&nbsp;&nbsp; }<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>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Gvsig_internacional mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Gvsig_internacional@listserv.gva.es">Gvsig_internacional@listserv.gva.es</a>
<a class="moz-txt-link-freetext" href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
Jorge Piera Llodr&aacute;
gvSIG Development Team
PRODEVELOP
Plaza Don Juan de Villarrasa, 14 - 5
46001 Valencia
Tel: +34 963510612
Fax: +34 963510908
e-mail: <a class="moz-txt-link-abbreviated" href="mailto:jpiera@prodevelop.es">jpiera@prodevelop.es</a>
<a class="moz-txt-link-freetext" href="http://www.prodevelop.es">http://www.prodevelop.es</a>
<a class="moz-txt-link-freetext" href="http://www.gvsig.org">http://www.gvsig.org</a>
</pre>
</body>
</html>