I don't think the tree is even rendered at this time.

Also, I think that the "do not add the default layers when the map includes at least one non-background layer" makes sense. I would change the test to:

```if (!layer.background) {```