added set layer method
legendinterface is now an optional argument