setLayer

abstract fun setLayer(layer: MapLayer): Int(source)

Sets the layer at the specified index to the given layer. If there is already a layer at the specified index, it is replaced by the new layer. If the specified index is out of bounds, an exception is thrown. This method will not modify the order of the layers and the height of the map.

Return

the index of the layer that was set

Parameters

layer

the layer to set

Throws

if the specified index is out of bounds