<pre class="javascript" style="font-size:12px;padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;line-height:1.333;background-color:rgb(249,249,249)"><font color="#003366"><b>I leran that if in an html file , add a wms layer using openlayer is like that.</b></font></pre>
<pre class="javascript" style="font-size:12px;padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;line-height:1.333;color:rgb(17,0,0);background-color:rgb(249,249,249)"><span style="color:rgb(0,51,102);font-weight:bold">function</span> init<span style="color:rgb(0,153,0)">(</span><span style="color:rgb(0,153,0)">)</span><span style="color:rgb(0,153,0)">{</span>
   map <span style="color:rgb(51,153,51)">=</span> <span style="color:rgb(0,51,102);font-weight:bold">new</span> OpenLayers.<span style="color:rgb(102,0,102)">Map</span><span style="color:rgb(0,153,0)">(</span> <span style="color:rgb(51,102,204)">'map'</span> <span style="color:rgb(0,153,0)">)</span><span style="color:rgb(51,153,51)">;</span>
   layer <span style="color:rgb(51,153,51)">=</span> <span style="color:rgb(0,51,102);font-weight:bold">new</span> OpenLayers.<span style="color:rgb(102,0,102)">Layer</span>.<span style="color:rgb(102,0,102)">MapServer</span><span style="color:rgb(0,153,0)">(</span> <span style="color:rgb(51,102,204)">"OpenLayers WMS"</span><span style="color:rgb(51,153,51)">,</span>
       <span style="color:rgb(51,102,204)">"<a href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</a>"</span><span style="color:rgb(51,153,51)">,</span> <span style="color:rgb(0,153,0)">{</span>layers<span style="color:rgb(51,153,51)">:</span> <span style="color:rgb(51,102,204)">'basic'</span><span style="color:rgb(0,153,0)">}</span> <span style="color:rgb(0,153,0)">)</span><span style="color:rgb(51,153,51)">;</span>
   map.<span style="color:rgb(102,0,102)">addLayer</span><span style="color:rgb(0,153,0)">(</span>layer<span style="color:rgb(0,153,0)">)</span><span style="color:rgb(51,153,51)">;</span>
   map.<span style="color:rgb(102,0,102)">zoomToMaxExtent</span><span style="color:rgb(0,153,0)">(</span><span style="color:rgb(0,153,0)">)</span><span style="color:rgb(51,153,51)">;</span></pre><pre class="javascript" style="font-size:12px;padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;line-height:1.333;color:rgb(17,0,0);background-color:rgb(249,249,249)">
<span style="color:rgb(51,153,51)"><br></span></pre><pre class="javascript" style="font-size:12px;padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;line-height:1.333;color:rgb(17,0,0);background-color:rgb(249,249,249)">
<span style="color:rgb(51,153,51)">I want to ask that if I want to add a non wms layer existing on my server, how shoul I do.</span></pre><pre class="javascript" style="font-size:12px;padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;line-height:1.333;color:rgb(17,0,0);background-color:rgb(249,249,249)">
<span style="color:rgb(51,153,51)">I use a mapfile to tell the mapserver configure info.</span></pre><pre class="javascript" style="padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;background-color:rgb(249,249,249)">
<font color="#339933" style="font-size:12px;line-height:1.333">for example,  I browse my map by the link "</font><span style="background-color:transparent;line-height:15px"><font color="#339933"><a href="http://222.129.51.186/cgi-bin/mapserv?&layers=all&map=/home/jack/osm-demo/basemaps/osm-google.map&template=openlayers">http://222.129.51.186/cgi-bin/mapserv?&layers=all&map=/home/jack/osm-demo/basemaps/osm-google.map&template=openlayers</a></font></span><span style="font-size:12px;line-height:1.333;color:rgb(51,153,51)">"</span></pre>
<pre class="javascript" style="padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;background-color:rgb(249,249,249)"><span style="font-size:12px;line-height:1.333;color:rgb(51,153,51)">where the </span><span style="color:rgb(51,153,51);background-color:transparent;line-height:15px">222.129.51.186 is my server IP.</span></pre>
<pre class="javascript" style="padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;background-color:rgb(249,249,249)"><span style="color:rgb(51,153,51);background-color:transparent;line-height:15px"><br>
</span></pre><pre class="javascript" style="padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;background-color:rgb(249,249,249)"><span style="color:rgb(51,153,51);background-color:transparent;line-height:15px">Now I want write these info in an html file ,how to define the layer?</span></pre>
<pre class="javascript" style="padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;background-color:rgb(249,249,249)"><span style="color:rgb(51,153,51);background-color:transparent;line-height:15px"><br>
</span></pre><pre class="javascript" style="font-size:12px;padding:7px;margin-top:0px;margin-bottom:0px;width:auto;clear:none;overflow:visible;line-height:1.333;color:rgb(17,0,0);background-color:rgb(249,249,249)"><span style="color:rgb(51,153,51)">layer = new Openlayer.Layer.Mapserver("...?what to contain?",..)</span></pre>
<div><br></div>-- <br><div style="text-align:left"><span style="text-align:-webkit-auto">Yang Li</span><div>GIS Developer</div><div>P.R.China</div><div><br></div></div><br>