The indentation and styling of this if/else block is a little ugly. Can you please clean it up?

Personally, I would format it like this:

<pre>
if (selectedLayer in layers) {
    // stuff
}
else {
    // stuff
}
</pre>