[GIS] Setting Base Layer in OpenLayers 3

openlayersopenlayers-2

I know there is a setBaseLayer function in OpenLayers 2. Is there a way I can accomplish that in OpenLayers 3?

Best Answer

You can set the base layer by doing:

var layers = this.map.getLayers();
layers.insertAt(0, base_layer);