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 (elastic#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>
(cherry picked from commit d7bce1c)
  • Loading branch information
nreese authored and kibanamachine committed Feb 1, 2022
1 parent d511aec commit 6b11b98
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 6b11b98

Please sign in to comment.