From d7bce1c95e91d5c5ad046097be6e6e4512149008 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Tue, 1 Feb 2022 05:14:20 -0700 Subject: [PATCH] [maps] fix Unable to load layers from WMS capabilities for a specific URL (#123386) * [maps] fix Unable to load layers from WMS spec for a specific URL * eslint Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../maps/public/classes/sources/wms_source/wms_client.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_client.js b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_client.js index d71c329ee7d3e..0cbcbcd7ab8fe 100644 --- a/x-pack/plugins/maps/public/classes/sources/wms_source/wms_client.js +++ b/x-pack/plugins/maps/public/classes/sources/wms_source/wms_client.js @@ -122,13 +122,17 @@ function reduceLayers(path, layers) { const updatedStyles = [...accumulatedCapabilities.styles]; if (_.has(layer, 'Style[0]')) { updatedStyles.push( - createOption(path, _.get(layer, 'Style[0].Title[0]'), _.get(layer, 'Style[0].Name[0]')) + createOption( + path, + _.get(layer, 'Style[0].Title[0]', ''), + _.get(layer, 'Style[0].Name[0]', '') + ) ); } return { layers: [ ...accumulatedCapabilities.layers, - createOption(path, layer.Title[0], layer.Name[0]), + createOption(path, _.get(layer, 'Title[0]', ''), _.get(layer, 'Name[0]', '')), ], styles: updatedStyles, };