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 clear="all"><br>-- <br>Bruno Gomes<br>