<commit_before>var log = require('cdb.log');
var View = require('../core/view');
var GeometryViewFactory = require('./geometry-views/geometry-view-factory');

var MapView = View.extend({

  className: 'CDB-Map-wrapper',

  initialize: function () {
    this.options = this.options || {};
    if (this.options.map === undefined) throw new Error('map is required');
    if (this.options.layerGroupModel === undefined) throw new Error('layerGroupModel is required');

    this._cartoDBLayerGroup = this.options.layerGroupModel;
    this.map = this.options.map;
    this.add_related_model(this.map);

    this._cartoDBLayerGroupView = null;

    // A map of the LayerViews that is linked to each of the Layer models.
    // The cid of the layer model is used as the key for this mapping.
    this._layerViews = {};

    this._bindModel();

    this.map.layers.bind('reset', this._addLayers, this);
    this.map.layers.bind('add', this._addLayer, this);
    this.map.layers.bind('remove', this._removeLayer, this);

    // TODO: When this.map.layers get new indexes, something needs to happen
    this.add_related_model(this.map.layers);<commit_msg>"Export" variable to window for debugging purposes<commit_after>var log = require('cdb.log');
var View = require('../core/view');
var GeometryViewFactory = require('./geometry-views/geometry-view-factory');

var MapView = View.extend({

  className: 'CDB-Map-wrapper',

  initialize: function () {
    // For debugging purposes
    window.mapView = this;

    this.options = this.options || {};
    if (this.options.map === undefined) throw new Error('map is required');
    if (this.options.layerGroupModel === undefined) throw new Error('layerGroupModel is required');

    this._cartoDBLayerGroup = this.options.layerGroupModel;
    this.map = this.options.map;
    this.add_related_model(this.map);

    this._cartoDBLayerGroupView = null;

    // A map of the LayerViews that is linked to each of the Layer models.
    // The cid of the layer model is used as the key for this mapping.
    this._layerViews = {};

    this._bindModel();

    this.map.layers.bind('reset', this._addLayers, this);
    this.map.layers.bind('add', this._addLayer, this);
    this.map.layers.bind('remove', this._removeLayer, this);

    // TODO: When this.map.layers get new indexes, something needs to happen
    this.add_related_model(this.map.layers);
{'fraction_non_alphanumeric': 0.13386487620646245, 'fraction_numerical': 0.0, 'mean_word_length': 3.6745098039215685, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3471359', 'n_tokens_mistral': 720, 'n_tokens_neox': 694, 'n_words': 192}