add function to update legend control like info control behavior