diff --git a/components/legend/legend.component.js b/components/legend/legend.component.js index dc8f356233..98b5116a82 100644 --- a/components/legend/legend.component.js +++ b/components/legend/legend.component.js @@ -20,6 +20,18 @@ export default { layer.on('change:visible', layerVisibilityChanged); } }, + /** + * Check if there is any visible layer + * @memberof hs.legend.controller + * @function noLayerExists + */ + noLayerExists: function () { + var visibleLayers = $scope.layerDescriptors.filter(function(check){ + return check.visible == true; + }); + console.log(visibleLayers); + return (visibleLayers.length == 0) + }, /** * Remove selected layer from legend items diff --git a/components/legend/partials/legend.html b/components/legend/partials/legend.html index 1c139cd679..2c701e86fb 100755 --- a/components/legend/partials/legend.html +++ b/components/legend/partials/legend.html @@ -2,6 +2,9 @@

+ +

No layer with legend exists!

+