Adds a layer. Layer verbosity is optional (default 0).
775300
def add(self, layer, verbosity = 0, position = None):
        
        layer._verbosity = verbosity
        layer._maxRandom = self._maxRandom
        layer.minTarget = 0.0
        layer.maxTarget = 1.0
        layer.minActivation = 0.0
        layer.maxActivation = 1.0
        if position == None:
            self.layers.append(layer)
        else:
            self.layers.insert(position, layer)
        self.layersByName[layer.name] = layer
847245
public static void insertBeforeCompass( WorldWindow wwd, Layer layer ) {
        // Insert the layer into the layer list just before the compass.
        int compassPosition = 0;
        LayerList layers = wwd.getModel().getLayers();
        for( Layer l : layers ) {
            if (l instanceof CompassLayer)
                compassPosition = layers.indexOf(l);
        }
        layers.add(compassPosition, layer);
    }
546155
public synchronized void addAll(Collection<Layer> layers, boolean redraw) {
        checkIsNull(layers);
        for (Layer layer : layers) {
            layer.setDisplayModel(this.displayModel);
        }
        this.layersList.addAll(layers);
        for (Layer layer : layers) {
            layer.assign(this.redrawer);
        }
        if (redraw) {
            this.redrawer.redrawLayers();
        }
    }
115884
public void addChild(PdfLayer child) {
        if (child.parent != null)
            throw new IllegalArgumentException("The layer '" + ((PdfString)child.get(PdfName.NAME)).toUnicodeString() + "' already has a parent.");
        child.parent = this;
        if (children == null)
            children = new ArrayList();
        children.add(child);
    }
1213853
def add_entity(self,entity):
        
        if self.entity_layer is None:
            self.entity_layer = Centities(type=self.type)
            self.root.append(self.entity_layer.get_node())
        self.entity_layer.add_entity(entity)
1325469
@Override
	public boolean addLayer(Layer layer) {
		if (layer == null) {
			throw new IllegalArgumentException("Layer is null.");
		}
		if (getLayer(layer.getId()) == null) {
			layers.add(layer);
			if (layer instanceof AbstractLayer) {
				AbstractLayer aLayer = (AbstractLayer) layer;
				aLayer.setViewPort(viewPort);
				aLayer.setEventBus(eventBus);
			}
			eventBus.fireEvent(new LayerAddedEvent(layer));
			return true;
		}
		return false;
	}
936632
def setVerbosity(self, value):
        
        self._verbosity = value
        for layer in self.layers:
            layer._verbosity = value
1304329
def load(self, _=None):
        
        for k, v in self.layer.iteritems():
            self.add(k, v['module'], v.get('package'))
1108504
int addLayer(ChildDrawable layer) {
        final LayerState st = mLayerState;
        final int N = st.mChildren != null ? st.mChildren.length : 0;
        final int i = st.mNum;
        if (i >= N) {
            final ChildDrawable[] nu = new ChildDrawable[N + 10];
            if (i > 0) {
                System.arraycopy(st.mChildren, 0, nu, 0, i);
            }

            st.mChildren = nu;
        }

        st.mChildren[i] = layer;
        st.mNum++;
        st.invalidateCache();
        return i;
    }
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
681035
def add(self, *l):
        '''
        '''
        for a in flatten(l):
            self._add([self.Inner(a)], self.l)
1210566
def _add_layer_clicked(self):
        """"""
        layer = self.tree.selectedItems()[0]
        origin = layer.data(0, LAYER_ORIGIN_ROLE)
        if origin == FROM_ANALYSIS['key']:
            parent = layer.data(0, LAYER_PARENT_ANALYSIS_ROLE)
            key = layer.data(0, LAYER_PURPOSE_KEY_OR_ID_ROLE)
            item = QListWidgetItem('%s - %s' % (layer.text(0), parent))
            item.setData(LAYER_PARENT_ANALYSIS_ROLE, parent)
            item.setData(LAYER_PURPOSE_KEY_OR_ID_ROLE, key)
        else:
            item = QListWidgetItem(layer.text(0))
            layer_id = layer.data(0, LAYER_PURPOSE_KEY_OR_ID_ROLE)
            item.setData(LAYER_PURPOSE_KEY_OR_ID_ROLE, layer_id)
        item.setData(LAYER_ORIGIN_ROLE, origin)
        self.list_layers_in_map_report.addItem(item)
        self.tree.invisibleRootItem().removeChild(layer)
        self.tree.clearSelection()
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;
        }
1012810
def add_object(self, obj):
        ''''''
        state = self.state
        if not obj.layer in state.layers:
            # its a new layer
            state.layers[obj.layer] = {}
        state.layers[obj.layer][obj.key] = obj
        state.need_redraw = True
1299364
def add_linguistic_processor(self, layer ,my_lp):
        
        ## Locate the linguisticProcessor element for taht layer
        found_lp_obj = None
        for this_lp in self.node.findall('linguisticProcessors'):
            lp_obj = ClinguisticProcessors(this_lp)
            if lp_obj.get_layer() == layer:
                found_lp_obj = lp_obj
                break
        
        if found_lp_obj is None:    #Not found
            found_lp_obj = ClinguisticProcessors()
            found_lp_obj.set_layer(layer)
            self.add_linguistic_processors(found_lp_obj)
            
        found_lp_obj.add_linguistic_processor(my_lp)
496230
function addLegend(layer, data, options) {
    data = data || {};
    if ( !this.options.fills ) {
      return;
    }

    var html = '<dl>';
    var label = '';
    if ( data.legendTitle ) {
      html = '<h2>' + data.legendTitle + '</h2>' + html;
    }
    for ( var fillKey in this.options.fills ) {

      if ( fillKey === 'defaultFill') {
        if (! data.defaultFillName ) {
          continue;
        }
        label = data.defaultFillName;
      } else {
        if (data.labels && data.labels[fillKey]) {
          label = data.labels[fillKey];
        } else {
          label= fillKey + ': ';
        }
      }
      html += '<dt>' + label + '</dt>';
      html += '<dd style="background-color:' +  this.options.fills[fillKey] + '">&nbsp;</dd>';
    }
    html += '</dl>';

    var hoverover = d3.select( this.options.element ).append('div')
      .attr('class', 'datamaps-legend')
      .html(html);
  }
631767
private void createImageAndGraphics(int layer) {
		layeredImage[layer] = new BufferedImage(tileWidth, tileHeight,
				BufferedImage.TYPE_INT_ARGB);
		layeredGraphics[layer] = layeredImage[layer].createGraphics();
		layeredGraphics[layer].setRenderingHint(
				RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
	}