base layer for all leaflet layers
320671
function(layerModel, leafletLayer, leafletMap) {
    this.leafletLayer = leafletLayer;
    this.leafletMap = leafletMap;
    this.model = layerModel;

    this.setModel(layerModel);

    this.type = layerModel.get('type') || layerModel.get('kind');
    this.type = this.type.toLowerCase();
  }
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();
}
652359
def fill_layer_combo(self):
        """"""
        project = QgsProject.instance()
        # MapLayers returns a QMap<QString id, QgsMapLayer layer>
        layers = list(project.mapLayers().values())

        extensions = tuple(extension_siblings.keys())
        for layer in layers:
            if layer.source().lower().endswith(extensions):
                icon = layer_icon(layer)
                self.layers.addItem(icon, layer.name(), layer.id())
630153
def layers(self):
        """"""
        if self._layers is None:
            self.__init()
        lyrs = []
        for lyr in self._layers:
            lyr['object'] = GlobeServiceLayer(url=self._url + "/%s" % lyr['id'],
                                              securityHandler=self._securityHandler,
                                              proxy_port=self._proxy_port,
                                              proxy_url=self._proxy_url)
            lyrs.append(lyr)

        return lyrs
1226328
function buildLayers(layersObject) {
	// Array of layers
	var layers = [];

	if (layersObject) {
		// Iterate over all layers
		for (var int = 0; int < layersObject.length; int++) {
			// One layer
			var singleLayer = layersObject[int];

			// Build a new layer object
			var layer = {};

			// Determine name from GetCapabilities document
			if (singleLayer.Name) {
				if (singleLayer.Name[0]) {
					layer.Name = singleLayer.Name[0];
				}
			}

			// Determine title from GetCapabilities document
			if (singleLayer.Title) {
				if (singleLayer.Title[0]) {
					layer.Title = singleLayer.Title[0];
				}
			}

			// Determine abstract from GetCapabilities document
			if (singleLayer.Abstract) {
				if (singleLayer.Abstract[0]) {
					layer.Abstract = singleLayer.Abstract[0];
				}
			}

			layer.Layer = buildLayers(singleLayer.Layer);

			// Determine layer name if not available
			layer.Name = determineLayerName(layer);

			// Determine layer title if not available
			if (!(layer.Title)) {
				layer.Title = layer.Name;
			}

			// Add layer to the array
			layers.push(layer);
		}
	}

	return layers;
}
664517
def encode_multiple_layers(out, features_by_layer, zoom):
    
    precision = precision_for_zoom(zoom)
    geojson = {}
    for layer_name, features in features_by_layer.items():
        fs = create_layer_feature_collection(features, precision)
        geojson[layer_name] = fs
    json.dump(geojson, out)
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");
                }
            }
        }
    }
683657
public void onSelectLayer(LayerSelectedEvent event) {
		for (TreeNode node : tree.getAllNodes()) {
			if (node.getName().equals(event.getLayer().getLabel())) {
				selectedLayerTreeNode = (LayerTreeTreeNode) node;
				treeGrid.selectRecord(selectedLayerTreeNode);
				htmlSelectedLayer.setContents(I18nProvider.getLayerTree().activeLayer(
						selectedLayerTreeNode.getLayer().getLabel()));

				// Canvas[] toolStripMembers = toolStrip.getMembers();
				// updateButtonIconsAndStates(toolStripMembers);
			}
		}
	}
907900
function styleLayer(layer) {
    var groups = _.map(layer, ruleGroup => {
        var groupedRules =  _.chain(ruleGroup.rules)
            .map(rule => {
                // Add conditions to each rule, if any
                var conditions = getConditions(rule);
                if (conditions && conditions.length > 0) {
                    rule.conditions = conditions;
                }
                return rule;
            })
            .groupBy(subRule => {
                // Group by conditions
                return stringify(subRule.conditions);
            })
            .value();
        return _.values(groupedRules);
    });

    return groups.map(ruleGroup => {
        try {
            return ruleGroup.map(ruleSubgroup => {
                return styleRuleGroup(ruleSubgroup);
            });
        }
        catch (e) {
            console.warn(e);
            return null;
        }
    });
}
480017
function (layer) {
		var path = layer._path = L.SVG.create('path');

		// @namespace Path
		// @option className: String = null
		// Custom class name set on an element. Only for SVG renderer.
		if (layer.options.className) {
			L.DomUtil.addClass(path, layer.options.className);
		}

		if (layer.options.interactive) {
			L.DomUtil.addClass(path, 'leaflet-interactive');
		}

		this._updateStyle(layer);
	}
1254677
function toggleLayerFromSplitMaps(state, layer) {
  return state.splitMaps.map(settings => {
    const {layers} = settings;
    const newLayers = {
      ...layers,
      [layer.id]: generateLayerMetaForSplitViews(layer)
    };

    return {
      ...settings,
      layers: newLayers
    };
  });
}
753391
function() {
        var index = this.layer.getZIndex() - 1;
        if (index >= this.map.Z_INDEX_BASE['Feature']) {
            this.layer.setZIndex(index);
        } else {
            this.map.setLayerZIndex(this.layer,
                this.map.getLayerIndex(this.layer));
        }
    }
188821
function(context) {
        var list = this.createElementDefaultNS("LayerList");
        
        for(var i=0, len=context.layersContext.length; i<len; ++i) {
            list.appendChild(this.write_wmc_Layer(context.layersContext[i]));
        }
        
        return list;
    }
994330
function() {
            var layers = this.children,
                len = layers.length,
                n;

            for(n = 0; n < len; n++) {
                layers[n].clear();
            }
            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});
	}
551754
function eachImg(layer, callback) {
      var imgtags = layer._container.children[0].children;
      for (var i in imgtags) {
        if (imgtags[i].tagName === 'IMG') {
          callback(imgtags[i]);
        }
      }
    }
670677
function generateColoredLayers(sources, assignLayerColor) {
  var polyLayers = [];
  var circleLayers = [];
  var lineLayers = [];

  function alphaColors(layerId) {
    var color = assignLayerColor.bind(null, layerId);
    var obj = {
      circle: color(0.8),
      line: color(0.6),
      polygon: color(0.3),
      polygonOutline: color(0.6),
      default: color(1)
    };
    return obj;
  }

  Object.keys(sources).forEach(function (sourceId) {
    var layers = sources[sourceId];

    if (!layers || layers.length === 0) {
      var colors = alphaColors(sourceId);
      circleLayers.push(circleLayer(colors.circle, sourceId));
      lineLayers.push(lineLayer(colors.line, sourceId));
      polyLayers.push(polygonLayer(colors.polygon, colors.polygonOutline, sourceId));
    } else {
      layers.forEach(function (layerId) {
        var colors = alphaColors(layerId);

        circleLayers.push(circleLayer(colors.circle, sourceId, layerId));
        lineLayers.push(lineLayer(colors.line, sourceId, layerId));
        polyLayers.push(polygonLayer(colors.polygon, colors.polygonOutline, sourceId, layerId));
      });
    }
  });

  return polyLayers.concat(lineLayers).concat(circleLayers);
}