Issue #224: Check for showInLegendHiddenLayers only when relevant.