APIMethod: setBaseLayer
Allows user to specify one of the currently-loaded layers as the Map's
new base layer.

Parameters:
newBaseLayer - {<OpenLayers.Layer>}
519275
function(newBaseLayer) {
        
        if (newBaseLayer != this.baseLayer) {
          
            // ensure newBaseLayer is already loaded
            if (OpenLayers.Util.indexOf(this.layers, newBaseLayer) != -1) {

                // preserve center and scale when changing base layers
                var center = this.getCachedCenter();
                var newResolution = OpenLayers.Util.getResolutionFromScale(
                    this.getScale(), newBaseLayer.units
                );

                // make the old base layer invisible 
                if (this.baseLayer != null && !this.allOverlays) {
                    this.baseLayer.setVisibility(false);
                }

                // set new baselayer
                this.baseLayer = newBaseLayer;
                
                if(!this.allOverlays || this.baseLayer.visibility) {
                    this.baseLayer.setVisibility(true);
                    // Layer may previously have been visible but not in range.
                    // In this case we need to redraw it to make it visible.
                    if (this.baseLayer.inRange === false) {
                        this.baseLayer.redraw();
                    }
                }

                // recenter the map
                if (center != null) {
                    // new zoom level derived from old scale
                    var newZoom = this.getZoomForResolution(
                        newResolution || this.resolution, true
                    );
                    // zoom and force zoom change
                    this.setCenter(center, newZoom, false, true);
                }

                this.events.triggerEvent("changebaselayer", {
                    layer: this.baseLayer
                });
            }        
        }
    }
1145687
function (layer) {
        for(var i = 0, len = this.layers.length; i < len; i++) {
            if (this.layers[i] == layer) {
                return false;
            }
        }
        if (this.events.triggerEvent("preaddlayer", {layer: layer}) === false) {
            return false;
        }
        if(this.allOverlays) {
            layer.isBaseLayer = false;
        }
        
        layer.div.className = "olLayerDiv";
        layer.div.style.overflow = "";
        this.setLayerZIndex(layer, this.layers.length);

        if (layer.isFixed) {
            this.viewPortDiv.appendChild(layer.div);
        } else {
            this.layerContainerDiv.appendChild(layer.div);
        }
        this.layers.push(layer);
        layer.setMap(this);

        if (layer.isBaseLayer || (this.allOverlays && !this.baseLayer))  {
            if (this.baseLayer == null) {
                // set the first baselaye we add as the baselayer
                this.setBaseLayer(layer);
            } else {
                layer.setVisibility(false);
            }
        } else {
            layer.redraw();
        }

        this.events.triggerEvent("addlayer", {layer: layer});
        layer.events.triggerEvent("added", {map: this, layer: layer});
        layer.afterAdd();

        return true;
    }
1357832
def setCurrentLayer(self, layer):
        
        if self._currentLayer == layer:
            return False
        
        old = self._currentLayer
        self._currentLayer = layer
        
        if old is not None:
            old.sync()
        if layer is not None:
            layer.sync()
        
        self.selectionFinished.emit()
        self.invalidate()
        
        return True
801239
function(map) {
        OpenLayers.Layer.Vector.prototype.setMap.apply(this, arguments);
        this.collectRoots();
        map.events.register("changelayer", this, this.handleChangeLayer);
    }
515823
function() {

        if (this.layers.length == this.map.layers.length) { 
            this.map.events.unregister('addlayer', this, this.configureLayers);

            for(var i=0, len=this.layers.length; i<len; i++) {
                
                var layer = this.map.layers[i];
                var c = this.layers.charAt(i);
                
                if (c == "B") {
                    this.map.setBaseLayer(layer);
                } else if ( (c == "T") || (c == "F") ) {
                    layer.setVisibility(c == "T");
                }
            }
        }
    }
827502
private void setBasecalls() {
		baseCalls = new int[seqLength];
		byte[] qq = new byte[seqLength * 2];
		getSubArray(qq, PLOC);
		DataInputStream dis = new DataInputStream(new ByteArrayInputStream(qq));
		for (int i = 0; i <= seqLength - 1; ++i) {
			try {
				baseCalls[i] = (int) dis.readShort();
			} catch (IOException e)//This shouldn't happen. If it does something must be seriously wrong.
			{
				throw new IllegalStateException("Unexpected IOException encountered while manipulating internal streams.");
			}
		}
	}
1035873
function (newOptions) {
        OpenLayers.Util.extend(this.options, newOptions);
        OpenLayers.Util.extend(this, newOptions);
    }
878954
public void setLayer(VectorLayer layer) {
		this.layer = layer;
		if (layer == null) {
			clear();
		} else {
			empty();
			updateFields();
		}
	}
1053943
function(layers) {
        if(OpenLayers.Util.isArray(layers)) {
            this.layers = layers;
            this.layer = new OpenLayers.Layer.Vector.RootContainer(
                this.id + "_container", {
                    layers: layers
                }
            );
        } else {
            this.layer = layers;
        }
    }
389418
public static void registerCustomLayer(String layerName, Class<? extends KerasLayer> configClass) {
        customLayers.put(layerName, configClass);
    }
317614
function(targets) {
        this.targets = [];
        if(targets && targets.length) {
            var target;
            for(var i=0, len=targets.length; i<len; ++i) {
                target = targets[i];
                if(target instanceof OpenLayers.Layer.Vector) {
                    this.addTargetLayer(target);
                } else {
                    this.addTarget(target);
                }
            }
        }
    }
1083834
@RequestMapping(value = "/setLayersForMap.action", method = RequestMethod.POST)
    public @ResponseBody
    java.util.Map<String, Object> setLayersForMap(
        @RequestParam("mapModuleId") Integer mapModuleId,
        @RequestParam("layerIds") List<Integer> layerIds) {
        try {
            if (mapModuleId == null || layerIds == null || layerIds.isEmpty()) {
                throw new Exception();
            }
            List<Layer> layers = this.service.setLayersForMap(mapModuleId, layerIds);
            return ResultSet.success(layers);
        } catch (Exception e) {
            return ResultSet.error(COULD_NOT_SET_ERROR_MSG);
        }
    }
190828
function () {
        if (!this.active) {
            if(this.layers) {
                this.map.addLayer(this.layer);
            }
            this.handlers.feature.activate();
            if(this.box && this.handlers.box) {
                this.handlers.box.activate();
            }
        }
        return OpenLayers.Control.prototype.activate.apply(
            this, arguments
        );
    }
328026
function setLayerData(layer, data) {
       var idx = 0; // initialize the array

       initArray(layer); // set everything

       for (var y = 0; y < layer.rows; y++) {
         for (var x = 0; x < layer.cols; x++) {
           // get the value of the gid
           var gid = data[idx++]; // fill the array

           if (gid !== 0) {
             // add a new tile to the layer
             layer.setTile(x, y, gid);
           }
         }
       }
     }
1238630
def add_layers(self, *layers):
		
		for layer in layers:
			if layer.name() in self.__layers.keys():
				raise ValueError('Layer "%s" already exists' % layer.name())
			self.__layers[layer.name()] = layer
599147
function makeBaseStackupLayer(layer) {
    var layerSide = layer.side
    var layerType = layer.type

    if (
      layer.filename &&
      typeof layerSide === 'undefined' &&
      typeof layerType === 'undefined'
    ) {
      var gerberId = layerTypes[layer.filename]
      layerSide = gerberId.side
      layerType = gerberId.type
    }

    var layerOptions = extend(layer.options)

    if (layerOptions.plotAsOutline == null && layerType === wtg.TYPE_OUTLINE) {
      layerOptions.plotAsOutline = true
    }

    if (
      options &&
      options.outlineGapFill != null &&
      layerOptions.plotAsOutline
    ) {
      layerOptions.plotAsOutline = options.outlineGapFill
    }

    return extend(layer, {
      side: layerSide,
      type: layerType,
      options: layerOptions,
    })
  }
626066
function createLayer(layerOrSource) {
  // @type {import("../layer/Layer.js").default}
  let layer;
  if (layerOrSource instanceof Source) {
    if (layerOrSource instanceof TileSource) {
      layer = new TileLayer({source: layerOrSource});
    } else if (layerOrSource instanceof ImageSource) {
      layer = new ImageLayer({source: layerOrSource});
    }
  } else {
    layer = layerOrSource;
  }
  return layer;
}