<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>AW: [OpenLayers-Users] Display Map from MapServer with OpenLayers</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">I just got this work, thank you!</FONT>

<BR><FONT SIZE=2 FACE="Arial">I needed to implement the following code:</FONT>
</P>

<P><B><FONT SIZE=2 FACE="Arial">var wmslayer = new OpenLayers.Layer.WMS( &quot;WMS Layer&quot;, &quot;</FONT></B><A HREF="http://domain.com/cgi-bin/mapserv?map=/path/to/file.map"><B><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://domain.com/cgi-bin/mapserv?map=/path/to/file.map</FONT></U></B></A><B><FONT SIZE=2 FACE="Arial">&quot;, {layers: 'Layername'} );</FONT></B></P>

<P><B><FONT SIZE=2 FACE="Arial">map.addLayers([wmslayer]);</FONT></B>
</P>

<P><FONT SIZE=2 FACE="Arial">Now, the only problem I have left is, that the distance measuring bar, sended by the mapserver, is displayed a few times inside the OL window. Is it possible to still use this dynamically generated bar with OL but have it displayed only once (for example in a corner)? Or do I have to disable this bar in the &quot;.map&quot;-File and can not use it in OL?</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Lucas</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">&nbsp;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">-----Ursprüngliche Nachricht-----</FONT>

<BR><FONT SIZE=2 FACE="Arial">Von: users-bounces@openlayers.org [</FONT><A HREF="mailto:users-bounces@openlayers.org"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">mailto:users-bounces@openlayers.org</FONT></U></A><FONT SIZE=2 FACE="Arial">] Im Auftrag von Barend Köbben</FONT>

<BR><FONT SIZE=2 FACE="Arial">Gesendet: Mittwoch, 9. Mai 2007 16:57</FONT>

<BR><FONT SIZE=2 FACE="Arial">An: Users@openlayers.org</FONT>

<BR><FONT SIZE=2 FACE="Arial">Betreff: Re: [OpenLayers-Users] Display Map from MapServer with OpenLayers</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&gt;Try this instead:</FONT>

<BR><FONT SIZE=2 FACE="Arial">&gt;</FONT>

<BR><FONT SIZE=2 FACE="Arial">&gt;layer = new OpenLayers.Layer.WMS( &quot;OpenLayers WMS&quot;, </FONT>

<BR><FONT SIZE=2 FACE="Arial">&gt;&quot;</FONT><A HREF="http://domain/cgi-bin/mapserv?map=/path/to/project.map"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://domain/cgi-bin/mapserv?map=/path/to/project.map</FONT></U></A><FONT SIZE=2 FACE="Arial"> </FONT>

<BR><FONT SIZE=2 FACE="Arial">&gt;&lt;</FONT><A HREF="http://domain/cgi-bin/mapserv?map=/path/to/project.map"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://domain/cgi-bin/mapserv?map=/path/to/project.map</FONT></U></A><FONT SIZE=2 FACE="Arial">&gt; &quot;, {layers: </FONT>

<BR><FONT SIZE=2 FACE="Arial">&gt;'basic'} );</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">...or, if you need SLD based stylings (as I did): </FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;</FONT>

<BR><FONT SIZE=2 FACE="Arial">&quot;</FONT><A HREF="http://domain/cgi-bin/mapserv?map=/path/to/project.map"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://domain/cgi-bin/mapserv?map=/path/to/project.map</FONT></U></A><FONT SIZE=2 FACE="Arial"> &lt;</FONT><A HREF="http://domain/cgi-bin/mapserv?map=/path/to/project.map"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://domain/cgi-bin/mapserv?map=/path/to/project.map</FONT></U></A><FONT SIZE=2 FACE="Arial">&gt; &quot;,</FONT>

<BR><FONT SIZE=2 FACE="Arial">{layers: &quot;landcover&quot;, </FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; SLD: &quot;url-to-your-SLD &lt;</FONT><A HREF="http://geoserver.itc.nl/mapserver/sld/galicia.xml"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://geoserver.itc.nl/mapserver/sld/galicia.xml</FONT></U></A><FONT SIZE=2 FACE="Arial">&gt; &quot;}</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; );</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;</FONT>

<BR><FONT SIZE=2 FACE="Arial">...and if you want the layer to be an overlay iso. a base layer:</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;</FONT>

<BR><FONT SIZE=2 FACE="Arial">&quot;</FONT><A HREF="http://domain/cgi-bin/mapserv?map=/path/to/project.map"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://domain/cgi-bin/mapserv?map=/path/to/project.map</FONT></U></A><FONT SIZE=2 FACE="Arial"> &lt;</FONT><A HREF="http://domain/cgi-bin/mapserv?map=/path/to/project.map"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://domain/cgi-bin/mapserv?map=/path/to/project.map</FONT></U></A><FONT SIZE=2 FACE="Arial">&gt; &quot;,</FONT>

<BR><FONT SIZE=2 FACE="Arial">{layers: &quot;landcover&quot;, </FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; SLD: &quot;url-to-your-SLD &lt;</FONT><A HREF="http://geoserver.itc.nl/mapserver/sld/galicia.xml"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://geoserver.itc.nl/mapserver/sld/galicia.xml</FONT></U></A><FONT SIZE=2 FACE="Arial">&gt; &quot;,</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; format: &quot;image/png&quot;,</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; transparent: &quot;true&quot;}</FONT>

<BR><FONT SIZE=2 FACE="Arial">&nbsp;&nbsp;&nbsp;&nbsp; );</FONT>

<BR><FONT SIZE=2 FACE="Arial">--</FONT>

<BR><FONT SIZE=2 FACE="Arial">Barend Köbben</FONT>

<BR><FONT SIZE=2 FACE="Arial">International Institute for Geo-information Sciences and&nbsp; Earth Observation (ITC) PO Box 6, 7500AA Enschede (The Netherlands)</FONT></P>

<P><FONT SIZE=2 FACE="Arial">ph: +31-(0)534874253; mobile: +31-(0)622344955</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">&nbsp;</FONT>

<BR><FONT SIZE=2 FACE="Arial">_______________________________________________</FONT>

<BR><FONT SIZE=2 FACE="Arial">Users mailing list</FONT>

<BR><FONT SIZE=2 FACE="Arial">Users@openlayers.org</FONT>

<BR><A HREF="http://openlayers.org/mailman/listinfo/users"><U><FONT COLOR="#0000FF" SIZE=2 FACE="Arial">http://openlayers.org/mailman/listinfo/users</FONT></U></A>
</P>

</BODY>
</HTML>