Added the possibilite to set/unset visible the layer
Mantain the layer index when the layer properties changes