[OpenLayers-Users] maxExtent error

Raul David Orozco hagen1113 at yahoo.com
Tue Jan 12 16:14:40 EST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100112/f857222e/attachment.html


More information about the Users mailing list