diff --git a/src/control/WMSCapabilities.js b/src/control/WMSCapabilities.js index f3d6a0fc..be83177a 100644 --- a/src/control/WMSCapabilities.js +++ b/src/control/WMSCapabilities.js @@ -716,7 +716,7 @@ var ol_control_WMSCapabilities = class olcontrolWMSCapabilities extends ol_contr } var source_opt = { - url: parent.Capability.Request.GetMap.DCPType[0].HTTP.Get.OnlineResource, + url: (parent.Capability.Request.GetMap.DCPType[0].HTTP.Get.OnlineResource || '').replace(/service=wms&?/i,''), projection: srs, attributions: attributions, crossOrigin: this.get('cors') ? 'anonymous' : null, @@ -868,32 +868,18 @@ var ol_control_WMSCapabilities = class olcontrolWMSCapabilities extends ol_contr this.getCapabilities(url, { onload: function (cap) { if (cap) { - // Find layer recursively - var findLayer = function(layers) { - for (var i=0; i