change legend on map typechange