I made a modification, now I have an empty as base layer (which I plan to 
replace later with a world layer but hosted local in my WMS) but still with no 
results. I tried the setallOverlays option too. Here is my code. Thanks again.

var request = OpenLayers.Request.GET(
            {url: 
"dir/wms.php?VERSION=1.1.1&REQUEST=GetCapabilities&SERVICE=WMS",
            success: function(response){
                            var XMLformat = new OpenLayers.Format.XML();
                            var xml = XMLformat.read(response.responseText);
                            var CAPformat = new 
OpenLayers.Format.WMSCapabilities();
                            var cap = CAPformat.read(xml);
                            
                            for (var i=0; i<cap.capability.layers.length; i++) {
                                layer = cap.capability.layers[i];
                                            
                                            if(layer.name == 'OCG:WMS'){
                                                layers_array[i] = new 
OpenLayers.Layer.WMS( layer.name, 
                                                "dir/wms.php", 
                                                {'layers': layer.name, 
isBaseLayer:true, format: "image/png", 'viewer': 'OpenLayers'}
                                                );
                                            }
                                            else{
                                                layers_array[i] = new 
OpenLayers.Layer.WMS( layer.name, 
                                                "dir/wms.php", 
                                                {'layers': layer.name, 
transparent: "true", format: "image/png", 'viewer': 'OpenLayers'}
                                                );
                                            }
                                                                             
                                
                                map.addLayer(layers_array[i]);
                            }
                            
                        },
                failure: function(response){
                            alert(response.status);
                            alert("GetCapabilities failed");
                                }
            }); 



      
____________________________________________________________________________________
¡Obtén la mejor experiencia en la web!
Descarga gratis el nuevo Internet Explorer 8. 
http://downloads.yahoo.com/ieak8/?l=e1
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to