Add a layer to the legend drop down panel.

@param layer
The layer who's legend to add to the drop down panel.
@return success or not.
961072
protected boolean addLayer(Layer layer) {
		int index = getLayerIndex(layer);
		if (index < 0) {
			view.add(new LayerControlPanel(mapPresenter, layer, disableToggleOutOfRange));

			return true;
		}
		return false;
	}
648819
function(layer) {
        if (!this.img || !layer) return;

        if (layer.type === "Canvas") {
            this._pattern = this._drawContext.createPattern(
                this.img,
                this._repeat
            );
        } else if (layer.type === "WebGL") {
            this._establishShader(
                "image:" + this.__image,
                Crafty.defaultShader("Image")
            );
            this.program.setTexture(
                this._drawLayer.makeTexture(
                    this.__image,
                    this.img,
                    this._repeat !== "no-repeat"
                )
            );
        }

        if (this._repeat === "no-repeat") {
            this.w = this.w || this.img.width;
            this.h = this.h || this.img.height;
        }

        this.ready = true;
        this.trigger("Invalidate");
    }
1009395
public LienzoPanel add(final Layer layer, final Layer... layers)
    {
        add(layer);

        for (final Layer node : layers)
        {
            add(node);
        }
        return this;
    }
519903
public void setCustomLayer(final BufferedImage CUSTOM_LAYER) {
        if (customLayer != null) {
            customLayer.flush();
        }
        customLayer = CUSTOM_LAYER;
        fireStateChanged();
    }
901035
public void addLayer(ClientLayerInfo layerInfo) {
		addLayerWithoutFireEvent(layerInfo);
		mapInfo.getLayers().add(layerInfo);
		handlerManager.fireEvent(new MapModelChangedEvent(this));
	}
285385
@Override
	public void registerLayerRenderer(Layer layer, LayerRenderer layerRenderer) {
		if (layerRenderers.containsKey(layer)) {
			layerRenderers.remove(layer);
		}
		layerRenderers.put(layer, layerRenderer);
	}
849934
private BufferedImage getImage(int layer) {
		BufferedImage image = layeredImage[layer];
		if (image == null) {
			createImageAndGraphics(layer);
			image = layeredImage[layer];
		}
		return image;
	}
389418
public static void registerCustomLayer(String layerName, Class<? extends KerasLayer> configClass) {
        customLayers.put(layerName, configClass);
    }
1098251
public void selectLayer(Layer<?> layer) {
		if (layer == null) {
			deselectLayer(this.getSelectedLayer());
		} else {
			Layer<?> selLayer = this.getSelectedLayer();
			if (selLayer != null && !layer.getId().equals(selLayer.getId())) {
				deselectLayer(selLayer);
			}
			layer.setSelected(true);
			handlerManager.fireEvent(new LayerSelectedEvent(layer));
		}
	}
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
1121349
@Override
	public Feature create(org.geomajas.layer.feature.Feature feature, FeaturesSupported layer) {
		Map<String, Attribute<?>> attributes = new HashMap<String, Attribute<?>>();
		for (String key : feature.getAttributes().keySet()) {
			attributes.put(key, new AttributeImpl(feature.getAttributes().get(key)));
		}
		return new FeatureImpl(layer, feature.getId(), attributes, feature.getGeometry(), feature.getLabel());
	}
992120
@Api
	public void addButton(String layerId, ToolStripButton button, int position) {
		extraButtons.add(new ExtraButton(constructIdSaveLayerId(layerId), button, position));
	}
204478
protected ListGridRecord createAndFillListGridRecord(Layer layer) {
		ListGridRecord record = new ListGridRecord();
		record.setAttribute(FLD_LABEL, layer.getLayerInfo().getLabel());
		record.setAttribute(FLD_VISIBILITY, layer.isShowing() ?
				WidgetLayout.iconLayerShow : WidgetLayout.iconLayerHide);
		record.setAttribute(FLD_OBJECT, layer);
		return record;
	}
897671
def add_layer(self, layer):
        
        assert (
            isinstance(layer,
                       (TiledTileLayer, TiledImageLayer, TiledObjectGroup)))

        self.layers.append(layer)
        self.layernames[layer.name] = layer
1184215
def add_exposure(self, layer):
        
        self._exposures.append(layer)
        self._is_ready = False
878954
public void setLayer(VectorLayer layer) {
		this.layer = layer;
		if (layer == null) {
			clear();
		} else {
			empty();
			updateFields();
		}
	}
1228361
function(layer) {
            var layers = this.layers,
                len, n;

            if (layers) {
                len = layers.length;

                // don't add the layer if it already exists
                for (n = 0; n < len; n++) {
                    if (layers[n]._id === layer._id) {
                        return false;
                    }
                }
            }
            else {
                this.layers = [];
            }

            this.layers.push(layer);
            return true;
        }