Fixed dynamic update of legend. Previously a new visible legend was added for each update. Now it is replaced.
Merge pull request #454 from mleegwt/master

Fixed dynamic update of legend