<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi. I'm having a little problem, I hope anyone can help me.<br><br>I make a GetCapabilities request to my wms server to determine the layers the server can offer me, using it's response I take the xml of the server's response to make the new OpenLayers.Layer.WMS call. Now here's my problem, later when I add the the layers to the map all the layers are created as base layers, but I need one layer to be the base layers and the others as overlays. How can I do that?. Here's my code:<br><br>var request = OpenLayers.Request.GET(<br> {url: "http://192.168.1.5:9090/smms/wms.php?VERSION=1.1.1&REQUEST=GetCapabilities&SERVICE=WMS",<br> success: function(response){<br>
var XMLformat = new OpenLayers.Format.XML();<br> var xml = XMLformat.read(response.responseText);<br> var CAPformat = new OpenLayers.Format.WMSCapabilities();<br> var cap = CAPformat.read(xml);<br> <br> for (var i=0;
i<cap.capability.layers.length; i++) {<br> layer = cap.capability.layers[i];<br> layers_array[i] = new OpenLayers.Layer.WMS( layer.name,<br> "http://192.168.1.5:9090/smms/wms.php",<br> { <br>
layers: layer.name, format: "image/png"}<br> );<br> map.addLayer(layers_array[i]);<br> }<br> },<br>
failure: function(response){<br> alert(response.status);<br> alert("GetCapabilities failed");<br> }<br> }); <br><br>The base layer or overlay attribute for a layer how's is determinated by OL?<br><br>And other question, I'm getting a bounds is null error, where are the bounds defined? In the call to OL, or in the info of the layer delivered by the WMS server. Thanx a lot for any help.<br></td></tr></table><br>
<hr size=1><br><font face="Verdana" size="-2">ˇObtén la mejor experiencia en la web!<br>Descarga gratis el nuevo Internet Explorer 8<br>
http://downloads.yahoo.com/ieak8/?l=e1</font>