legends switch on map change