3

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

Jazon
  • 231
  • 2
  • 11
  • As far as I know, there is no concept of a baselayer in OL3, you can have multiple layers, and you can set visibility on them. This might help, http://gis.stackexchange.com/questions/73982/openlayers-3-layer-visibility – John Powell Oct 10 '14 at 15:42
  • What are you trying to achieve? There is likely to be another way of doing it. – John Powell Oct 10 '14 at 15:43
  • 1
    You're right. Getting all the layers and just insert a layer at index 0 did the trick. – Jazon Oct 14 '14 at 17:27

1 Answers1

10

You can set the base layer by doing:

var layers = this.map.getLayers();
layers.insertAt(0, base_layer);
Jazon
  • 231
  • 2
  • 11