Checks in and adds an array of layers to this group.
Layer Groups are also added to the map to fire their event.
@param layers (L.Layer|L.Layer[]) single and/or group layers to be added.
@returns {L.MarkerClusterGroup.LayerSupport} this.
327976
function (layers) {
		var layersArray = this._toArray(layers),
		    separated = this._checkInGetSeparated(layersArray),
		    groups = separated.groups,
		    i, group, id;

		// Batch add all single layers.
		this._originalAddLayers(separated.singles);

		// Add Layer Groups to the map so that they are registered there and
		// the map fires 'layeradd' events for them as well.
		for (i = 0; i < groups.length; i++) {
			group = groups[i];
			id = L.stamp(group);
			this._proxyLayerGroups[id] = group;
			delete this._proxyLayerGroupsNeedRemoving[id];
			if (this._map) {
				this._map._originalAddLayer(group);
			}
		}
	}
1157646
function addNewLayersToSplitMap(splitMaps, layers) {
  const newLayers = Array.isArray(layers) ? layers : [layers];

  if (!splitMaps || !splitMaps.length || !newLayers.length) {
    return splitMaps;
  }

  // add new layer to both maps,
  //  don't override, if layer.id is already in splitMaps.settings.layers
  return splitMaps.map(settings => ({
    ...settings,
    layers: {
      ...settings.layers,
      ...newLayers.reduce(
        (accu, newLayer) =>
          newLayer.config.isVisible
            ? {
                ...accu,
                [newLayer.id]: settings.layers[newLayer.id]
                  ? settings.layers[newLayer.id]
                  : generateLayerMetaForSplitViews(newLayer)
              }
            : accu,
        {}
      )
    }
  }));
}
242828
function(layer) {
            if (arguments.length > 1) {
                for (var i = 0; i < arguments.length; i++) {
                    this.add(arguments[i]);
                }
                return;
            }
            Kinetic.Container.prototype.add.call(this, layer);
            layer._setCanvasSize(this.width(), this.height());

            // draw layer and append canvas to container
            layer.draw();
            this.content.appendChild(layer.canvas._canvas);

            // chainable
            return this;
        }
354393
function _updateLayerGroups($canvas, data, layer, props) {
	var groupMap = data.layer.groups,
		group, groupName, g,
		index, l;

	// If group name is not changing
	if (!props) {

		props = layer;

	} else {

		// Remove layer from all of its associated groups
		if (props.groups !== undefined && layer.groups !== null) {
			for (g = 0; g < layer.groups.length; g += 1) {
				groupName = layer.groups[g];
				group = groupMap[groupName];
				if (group) {
					// Remove layer from its old layer group entry
					for (l = 0; l < group.length; l += 1) {
						if (group[l] === layer) {
							// Keep track of the layer's initial index
							index = l;
							// Remove layer once found
							group.splice(l, 1);
							break;
						}
					}
					// Remove layer group entry if group is empty
					if (group.length === 0) {
						delete groupMap[groupName];
					}
				}
			}
		}

	}

	// Add layer to new group if a new group name is given
	if (props.groups !== undefined && props.groups !== null) {

		for (g = 0; g < props.groups.length; g += 1) {

			groupName = props.groups[g];

			group = groupMap[groupName];
			if (!group) {
				// Create new group entry if it doesn't exist
				group = groupMap[groupName] = [];
				group.name = groupName;
			}
			if (index === undefined) {
				// Add layer to end of group unless otherwise stated
				index = group.length;
			}
			// Add layer to its new layer group
			group.splice(index, 0, layer);

		}

	}
}
861163
private Collection<Refreshable> getLayer(Integer layer)
    {
        final Collection<Refreshable> refreshables;
        if (!layers.containsKey(layer))
        {
            refreshables = new HashSet<>();
            layers.put(layer, refreshables);
        }
        else
        {
            refreshables = layers.get(layer);
        }
        return refreshables;
    }
413719
public Callbacks add(com.google.gwt.core.client.Callback<?, ?>... c) {
    addAll((Object[]) c);
    return this;
  }
1268846
function (layer) {
		if (this.hasLayer(layer)) {
			return this;
		}

		layer.addEventParent(this);

		var id = L.stamp(layer);

		this._layers[id] = layer;

		if (this._map) {
			// Use the original map addLayer.
			this._map._originalAddLayer(layer);
		}

		return this.fire('layeradd', {layer: layer});
	}
712295
private Collection<Displayable> getLayer(Integer layer)
    {
        final Collection<Displayable> displayables;
        if (!layers.containsKey(layer))
        {
            displayables = new HashSet<>();
            layers.put(layer, displayables);
        }
        else
        {
            displayables = layers.get(layer);
        }
        return displayables;
    }
95269
@SuppressWarnings("unchecked")
    @PreAuthorize("hasRole(@configHolder.getSuperAdminRoleName()) or hasPermission(#mapModuleId, 'de.terrestris.shoguncore.model.module.Map', 'UPDATE')")
    public List<Layer> setLayersForMap(Integer mapModuleId, List<Integer> layerIds) throws Exception {
        E module = this.findById(mapModuleId);
        List<Layer> layers = new ArrayList<Layer>();

        if (module instanceof Map) {
            Map mapModule = (Map) module;
            for (Integer id : layerIds) {
                PersistentObject entity = this.layerService.findById(id);
                if (entity instanceof Layer) {
                    Layer layer = (Layer) entity;
                    if (layer != null) {
                        layers.add(layer);
                    }
                }
            }
            mapModule.setMapLayers(layers);
            this.saveOrUpdate((E) mapModule);
            return layers;
        } else {
            throw new Exception("Can't find mapModule with id " + mapModuleId.toString());
        }

    }
1209488
function(layerModel, gmapsLayer, gmapsMap) {
  this.gmapsLayer = gmapsLayer;
  this.map = this.gmapsMap = gmapsMap;
  this.model = layerModel;
  this.model.bind('change', this._update, this);

  this.type = layerModel.get('type') || layerModel.get('kind');
  this.type = this.type.toLowerCase();
}
1036508
@Api
	public Layer<?> getLayer(String layerId) {
		if (layers != null) {
			for (Layer<?> layer : layers) {
				if (layer.getId().equals(layerId)) {
					return layer;
				}
			}
		}
		return null;
	}
626960
public void setLayerDigests(java.util.Collection<String> layerDigests) {
        if (layerDigests == null) {
            this.layerDigests = null;
            return;
        }

        this.layerDigests = new java.util.ArrayList<String>(layerDigests);
    }
747735
function Layer () {
    Layer.superclass.constructor.call(this)

    var s = Director.sharedDirector.winSize

    this.isRelativeAnchorPoint = false
    this.anchorPoint = ccp(0.5, 0.5)
    this.contentSize = s

    if (!Director.sharedDirector.isTouchScreen) {
        events.addPropertyListener(this, 'isMouseEnabled', 'change', function () {
            if (this.isRunning) {
                if (this.isMouseEnabled) {
                    EventDispatcher.sharedDispatcher.addMouseDelegate({delegate: this, priority: this.mouseDelegatePriority})
                } else {
                    EventDispatcher.sharedDispatcher.removeMouseDelegate({delegate: this})
                }
            }
        }.bind(this))

        events.addPropertyListener(this, 'isKeyboardEnabled', 'change', function () {
            if (this.isRunning) {
                if (this.isKeyboardEnabled) {
                    EventDispatcher.sharedDispatcher.addKeyboardDelegate({delegate: this, priority: this.keyboardDelegatePriority})
                } else {
                    EventDispatcher.sharedDispatcher.removeKeyboardDelegate({delegate: this})
                }
            }
        }.bind(this))
    }
}
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
341709
public function layer($layers) {
        if ($layers instanceof Middleware) {
            $layers = $layers->toArray();
        }
        if ($layers instanceof MiddlewareInterface) {
            $layers = [$layers];
        }
        if (!is_array($layers)) {
            throw new InvalidArgumentException(get_class($layers) . " is not a valid middleware.");
        }
        $this->layers = array_merge($this->layers, $layers);
    }
869211
@Override
    protected void createLayers() {
        TileRendererLayer tileRendererLayer = AndroidUtil.createTileRendererLayer(this.tileCaches.get(0),
                this.mapView.getModel().mapViewPosition, getMapFile(), getRenderTheme(), false, true, false);
        this.mapView.getLayerManager().getLayers().add(tileRendererLayer);
    }
1320858
@Override
	protected void addOverlays() {
		super.addOverlays();

		final Context context = getActivity();

		/* Itemized Overlay */
		final ItemizedOverlayWithFocus<OverlayItem> iconOverlay;
		{
			/* Create a static ItemizedOverlay showing some Markers on various cities. */
			final ArrayList<OverlayItem> items = new ArrayList<>();
               for (int i=0; i < 5000; i++){
                    double random_lon= MapView.getTileSystem().getRandomLongitude(Math.random());
                    double random_lat = MapView.getTileSystem().getRandomLatitude(Math.random());
                         items.add(new OverlayItem("A random point", "SampleDescription", new GeoPoint(random_lat,
                                   random_lon))); 
               }
			items.add(new OverlayItem("Berlin", "This is a relatively short SampleDescription.",
					new GeoPoint(52.518333, 13.408333))); // Berlin
			items.add(new OverlayItem(
					"Washington",
					"This SampleDescription is a pretty long one. Almost as long as a the great wall in china.",
					new GeoPoint(38.895000, -77.036667))); // Washington
			items.add(new OverlayItem("San Francisco", "SampleDescription", new GeoPoint(37.779300,
					-122.419200))); // San Francisco

			/* OnTapListener for the Markers, shows a simple Toast. */
			iconOverlay = new ItemizedOverlayWithFocus<>(items,
					new ItemizedIconOverlay.OnItemGestureListener<OverlayItem>() {
						@Override
						public boolean onItemSingleTapUp(final int index, final OverlayItem item) {
							Toast.makeText(
									context,
									"Item '" + item.getTitle() + "' (index=" + index
											+ ") got single tapped up", Toast.LENGTH_LONG).show();
							return true;
						}

						@Override
						public boolean onItemLongPress(final int index, final OverlayItem item) {
							Toast.makeText(
									context,
									"Item '" + item.getTitle() + "' (index=" + index
											+ ") got long pressed", Toast.LENGTH_LONG).show();
							return true;
						}
					}, context);
			iconOverlay.setFocusItemsOnTap(true);
			iconOverlay.setFocusedItem(0);

			mMapView.getOverlays().add(iconOverlay);

			final RotationGestureOverlay mRotationGestureOverlay;
			mRotationGestureOverlay = new RotationGestureOverlay(mMapView);
			mRotationGestureOverlay.setEnabled(false);
			mMapView.getOverlays().add(mRotationGestureOverlay);
		}

		final RotationGestureOverlay rotationGestureOverlay = new RotationGestureOverlay(mMapView);
		rotationGestureOverlay.setEnabled(true);
		mMapView.getOverlays().add(rotationGestureOverlay);

		// Zoom and center on the focused item.
		mMapView.getController().setZoom(5.);
        IGeoPoint geoPoint = iconOverlay.getFocusedItem().getPoint();
		mMapView.getController().animateTo(geoPoint);

	}