I looked into backgroundlayer directive a little more. When we want to address the issue introduced when using `getLayers().clear()` here, we'll have to change the logic in there considerably and making implicit assumptions that don't make sense when looking at the background directive only.

So even when `getLayers().clear()` would result in much less code in this PR, I would like to keep this proposed solution, as it doesn't introduce a regression.

I have nothing against somebody else looking into this though and would welcome any improvements that make sense.