Extension function to add a Layer provided by the Style Extension to the Style.
the index that the current layer is added on
The layer to be added