<div>Hello,</div>
<div> </div>
<div>I tried to used the example of M.Sorel but Eclipse says that the constructor of WebMapServer(URL, WMSVersion) is not defined. But I saw in the library and the Constructor is in. So I don&#39;t understand why it doesn&#39;t work.</div>

<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<p>package wms;</p>
<p>import java.net.URL;</p>
<p>import org.geotoolkit.gui.swing.go2.JMap2DFrame;<br>import org.geotoolkit.map.MapBuilder;<br>import org.geotoolkit.map.MapContext;<br>import org.geotoolkit.referencing.crs.DefaultGeographicCRS;<br>import org.geotoolkit.wms.WebMapServer;<br>
import org.geotoolkit.wms.map.WMSMapLayer;<br>import org.geotoolkit.wms.xml.WMSVersion;</p>
<div>public class TWMS { 
<div><span></span> </div></div></blockquote>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<p> public static void main(String[] args) {<br>  <br>  MapContext lMapContext = MapBuilder.createContext(DefaultGeographicCRS.WGS84);<br>  URL serverURL = new URL(&quot;<a href="http://localhost/cgi-bin/mapserv.exe?map=toto&amp;REQUEST=getcapabilities">http://localhost/cgi-bin/mapserv.exe?map=toto&amp;REQUEST=getcapabilities</a>&quot;);<br>
</p></blockquote>
<div>//Error on this line the constructor is not defined</div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>  WebMapServer lWMS = WebMapServer(serverURL, WMSVersion.v111);<br>  //FeatureTypeBuilder lFeature = new FeatureTypeBuilder();<br>  WMSMapLayer lWmsMapLayer = new WMSMapLayer(lWMS, &quot;sr57_depare&quot;);<br>  lMapContext.layers().add(lWmsMapLayer);<br>
  <br>  JMap2DFrame.show(lMapContext);<br>  <br>  <br> }<br>}<br><br></div></blockquote>
<div> </div>
<div>Sorry for my English and thanks to help me.</div>
<div> </div>
<div>Toshy</div>
<div> </div>
<div class="gmail_quote">Le 15 avril 2010 15:10, johann sorel <span dir="ltr">&lt;<a href="mailto:johann.sorel@geomatys.fr">johann.sorel@geomatys.fr</a>&gt;</span> a écrit :<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hello,<br><br>I dont have the geotoolkit code in front of me (holidays) so the following guide might be a bit abstract but should help you.<br>
<br>Every default map objects are created by using the MapBuilder utility class.<br>MapContext context =  MapBuilder.createContext(DefaultGeographicCRS.WGS84);<br>The coordinate reference system provided here will only be used when you call getEnvelope<br>
on the context, it is not used at rendering time.<br><br>The SimpleFeatureTypeBuilder doesn&#39;t exist anymore in the latest code, it&#39;s replaced by FeatureTypeBuilder.<br><br><br>To add a WMS layer you must first create a server :<br>
WebMapServer wmsServer = WebMapServer(serverURL,version)<br>Then a layer :<br>WMSMapLayer wmsLayer = new WMSMapLayer(wmsServer, &quot;layerName&quot;);<br><br>Add it in the MapContext and that&#39;s it.<br>context.layers().add(wmsLayer);<br>
<br>TIP 1 : to quickly verify a MapContext, you can use JMap2DFrame.show(context);<br>This will display a complete frame, with several map tools, tree, style editor ... and so on.<br>TIP 2 : to render mapcontext as an image use the class DefaultPortrayalService<br>
<a href="http://pending.geotoolkit.org/apidocs/org/geotoolkit/display2d/service/DefaultPortrayalService.html" target="_blank">http://pending.geotoolkit.org/apidocs/org/geotoolkit/display2d/service/DefaultPortrayalService.html</a><br>
TIP 3 : the swing map widget class is JMap2D .<br><br><br>We currently don&#39;t have much tutorial nor javadoc in geotk-pending so if you have ideas for tutorial<br>feel free to send them on the mailing list.<br><br>johann sorel (in holidays)<br>
<br><br><br>Martin Desruisseaux a écrit : 
<div>
<div></div>
<div class="h5"><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hello Didier, and welcome!<br><br>Since the Geotoolkit project tries to reach an international user bases, the mails need to be in English. No worry, I will summarize your question.<br>
<br>In short, Didier downloaded geotk-bundle.pack.gz, unpacked it and have been able to run the Plot2D widget, but not the more elaborated widgets based on MapContext, SingleFeatureTypeBuilder, etc.<br><br>This is normal since geotk-bundle.pack.gz contains only the stable part of Geotk. The MapContext and other classes live in the pending part for now. You can download a bundle which contains everything (both the stable and pending parts with all there dependencies) there:<br>
<br>   <a href="http://hudson.geomatys.com/job/Geotoolkit-pending/" target="_blank">http://hudson.geomatys.com/job/Geotoolkit-pending/</a><br><br>This remind me that I need to provide a link on the Geotk web page...<br><br>
The second question that Didier asks is: is it possible to use data from a WMS server with Geotk? The answer is yes, using the geotk-client-wms module (included in the above-cited pack). However in order to get an example about how to use them, we need to hope that Johan Sorel read his email during his holiday :) (he is in holiday right now).<br>
<br>A third issue raised by Didier is that the demo applet don&#39;t work in his browser. This is a know issue that I need to fix; things are made more difficult by the fact that I&#39;m developing on a Mac platform, and applet behavior seems to change more than standard Java applications between browsers.<br>
<br>   Regards,<br><br>       Martin<br>_______________________________________________<br>Geotoolkit mailing list<br><a href="mailto:Geotoolkit@lists.osgeo.org" target="_blank">Geotoolkit@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/geotoolkit" target="_blank">http://lists.osgeo.org/mailman/listinfo/geotoolkit</a><br>
<br></blockquote><br>_______________________________________________<br>Geotoolkit mailing list<br><a href="mailto:Geotoolkit@lists.osgeo.org" target="_blank">Geotoolkit@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/geotoolkit" target="_blank">http://lists.osgeo.org/mailman/listinfo/geotoolkit</a><br>
</div></div></blockquote></div><br>