<commit_before>/**
 * @ngdoc object
 * @name anol.layer.Layer
 *
 * @param {Object} options AnOl Layer options
 * @param {string} options.title Layer title
 * @param {string} options.displayInLayerswitcher Show in layerswitcher
 * @param {boolean} options.permalink Add layer to permalink url. Default true. When displayInLayerswitcher is false, permalink is always false.
 * @param {boolean} options.isBackgorund Define layer as background layer
 * @param {Object} options.featureinfo Stores informations for feature info
 * @param {string} options.featureinfo.target Target of *GetFeatureInfo* request for {@link api/anol.featureinfo anol.featureinfo}. Supported values are:
 * - *_popup* - Results displayed in a popup
 * - *_blank* - Results displayed in a new window/tab
 * - *[id]* - Id of html element to display results in
 * @param {Array<string>} options.featureinfo.properties List of feature properties to show in {@link api/anol.featurepopup anol.featurepopup}.
 * @param {nu,ber} options.featureinfo.featureCount FEATURE_COUNT parameter for getFeatureInfo requests
 * @param {Object} options.legend Stores informations for legend
 * @param {string} options.legend.type Type of legend entry. Supported values are:
 * - *point* - Extracts point style of vector layer for legend
 * - *line* - Extracts line style of vector layer for legend
 * - *polygon* - Extracts polygon style of vector layer for legend
 * - *GetLegendGraphic* - Use options.legend.url for legend
 * @param {string} options.legend.url Url to image for display in legend
 * @param {string} otpions.legend.target Id of html element to display legend image in. (Only for options.legend.type == 'GetLegendGraphic').
 *                                       If empty, legend image is shown in legend control
 * @param {Object} options.olLayer OpenLayers layer object
 *
 * @description
 * Object for wrapping ol3 layers and add properties to them
 * You can create a normal ol3 layer and give it to a anol.layer.Layer
 *
 * @example
 * ```js
 *   // create ol layer
 *   var olLayer = new ol.layer.Vector({
 *     source: new ol.source.Vector()
 *   });
 *   var anolLayer = new anol.layer.Layer({
 *     title: "Awesome layer",
 *     olLayer: olLayer
 *   });
 * ```
 */
anol.layer.Layer = function(options) {
    if(options === false) {
        return;
    }
    options = $.extend(true, {}, this.DEFAULT_OPTIONS, options);
    this.name = options.name;
    this.title = options.title;
    this.isBackground = options.isBackground || false;
    this.featureinfo = options.featureinfo || false;
    this.legend = options.legend || false;
    this.attribution = options.attribution || undefined;
    this.isVector = false;
    this.displayInLayerswitcher = anol.helper.getValue(options.displayInLayerswitcher, true);

    if(this.displayInLayerswitcher === false) {
        this.permalink = false;
    } else {
        this.permalink = anol.helper.getValue(options.permalink, true);
    }

    this.olSourceOptions = this._createSourceOptions(options.olLayer.source);
    delete options.olLayer.source;
    this.olLayerOptions = options.olLayer;

    this.olLayer = undefined;
};

anol.layer.Layer.prototype = {
    CLASS_NAME: 'anol.layer.Layer',
    OL_LAYER_CLASS: undefined,
    OL_SOURCE_CLASS: undefined,
    DEFAULT_OPTIONS: {
        olLayer: {
            source: {}
        }
    },
    setOlLayer: function(olLayer) {<commit_msg>Restored creating anol.layer.Layer with defined olLayer<commit_after>/**
 * @ngdoc object
 * @name anol.layer.Layer
 *
 * @param {Object} options AnOl Layer options
 * @param {string} options.title Layer title
 * @param {string} options.displayInLayerswitcher Show in layerswitcher
 * @param {boolean} options.permalink Add layer to permalink url. Default true. When displayInLayerswitcher is false, permalink is always false.
 * @param {boolean} options.isBackgorund Define layer as background layer
 * @param {Object} options.featureinfo Stores informations for feature info
 * @param {string} options.featureinfo.target Target of *GetFeatureInfo* request for {@link api/anol.featureinfo anol.featureinfo}. Supported values are:
 * - *_popup* - Results displayed in a popup
 * - *_blank* - Results displayed in a new window/tab
 * - *[id]* - Id of html element to display results in
 * @param {Array<string>} options.featureinfo.properties List of feature properties to show in {@link api/anol.featurepopup anol.featurepopup}.
 * @param {nu,ber} options.featureinfo.featureCount FEATURE_COUNT parameter for getFeatureInfo requests
 * @param {Object} options.legend Stores informations for legend
 * @param {string} options.legend.type Type of legend entry. Supported values are:
 * - *point* - Extracts point style of vector layer for legend
 * - *line* - Extracts line style of vector layer for legend
 * - *polygon* - Extracts polygon style of vector layer for legend
 * - *GetLegendGraphic* - Use options.legend.url for legend
 * @param {string} options.legend.url Url to image for display in legend
 * @param {string} otpions.legend.target Id of html element to display legend image in. (Only for options.legend.type == 'GetLegendGraphic').
 *                                       If empty, legend image is shown in legend control
 * @param {Object} options.olLayer OpenLayers layer object
 *
 * @description
 * Object for wrapping ol3 layers and add properties to them
 * You can create a normal ol3 layer and give it to a anol.layer.Layer
 *
 * @example
 * ```js
 *   // create ol layer
 *   var olLayer = new ol.layer.Vector({
 *     source: new ol.source.Vector()
 *   });
 *   var anolLayer = new anol.layer.Layer({
 *     title: "Awesome layer",
 *     olLayer: olLayer
 *   });
 * ```
 */
anol.layer.Layer = function(options) {
    if(options === false) {
        return;
    }
    options = $.extend(true, {}, this.DEFAULT_OPTIONS, options);
    this.name = options.name;
    this.title = options.title;
    this.isBackground = options.isBackground || false;
    this.featureinfo = options.featureinfo || false;
    this.legend = options.legend || false;
    this.attribution = options.attribution || undefined;
    this.isVector = false;
    this.displayInLayerswitcher = anol.helper.getValue(options.displayInLayerswitcher, true);

    if(this.displayInLayerswitcher === false) {
        this.permalink = false;
    } else {
        this.permalink = anol.helper.getValue(options.permalink, true);
    }

    // keep ability to create anol.layer.Layer with predefined olLayer
    // this is needed for system layers in measure/print/etc.
    if(options.olLayer instanceof ol.layer.Base) {
        this.olLayer = options.olLayer;
    } else {
        this.olSourceOptions = this._createSourceOptions(options.olLayer.source);
        delete options.olLayer.source;
        this.olLayerOptions = options.olLayer;
        this.olLayer = undefined;
    }
};

anol.layer.Layer.prototype = {
    CLASS_NAME: 'anol.layer.Layer',
    OL_LAYER_CLASS: undefined,
    OL_SOURCE_CLASS: undefined,
    DEFAULT_OPTIONS: {
        olLayer: {
            source: {}
        }
    },
    setOlLayer: function(olLayer) {
{'fraction_non_alphanumeric': 0.10513036164844407, 'fraction_numerical': 0.000560695262125035, 'mean_word_length': 3.3826781326781328, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2801559', 'n_tokens_mistral': 2122, 'n_tokens_neox': 2037, 'n_words': 639}