Moved legend startup to after layerChooser creation.