Skip to content

Commit

Permalink
[maps] fix Unable to load layers from WMS capabilities for a specific…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
nreese and kibanamachine authored Feb 1, 2022
1 parent 111b830 commit d7bce1c
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit d7bce1c

Please sign in to comment.