populate/depopulate legend as layers come and go