diff --git a/lib/OpenLayers/Format/WMSCapabilities/v1.js b/lib/OpenLayers/Format/WMSCapabilities/v1.js index dd3c498b6c9..52d4ebbb610 100644 --- a/lib/OpenLayers/Format/WMSCapabilities/v1.js +++ b/lib/OpenLayers/Format/WMSCapabilities/v1.js @@ -71,117 +71,10 @@ OpenLayers.Format.WMSCapabilities.v1 = OpenLayers.Class( // an exception must have occurred, so parse it var parser = new OpenLayers.Format.OGCExceptionReport(); capabilities.error = parser.read(raw); - } else { - // postprocess the layer list - this.postProcessLayers(capabilities); } return capabilities; }, - /** - * Method: postProcessLayers - * Post process the layers, so that the nested layer structure is converted - * to a flat layer list with only named layers. - * - * Parameters: - * capabilities - {Object} The object (structure) returned by the parser with - * all the info from the GetCapabilities response. - */ - postProcessLayers: function(capabilities) { - if (capabilities.capability) { - capabilities.capability.layers = []; - var layers = capabilities.capability.nestedLayers; - for (var i=0, len = layers.length; i 0) { layer.prefix = parts[0]; } + capability.layers.push(layer); + if (layer.formats === undefined) { + layer.formats = request.getmap.formats; + } + if (layer.infoFormats === undefined && gfi) { + layer.infoFormats = gfi.formats; + } } }, "Attribution": function(node, obj) {