Did you manage to do it?
I had a read through morztezamg63’s github but this is about modifying layers that already exist in the class.
How would you add new layers dynamically without changing the class core code?