<commit_before>
/// <reference path="../../typings/tsd.d.ts" />


class Map extends L.Map {

    private _data               : IDataRow[];
    private _bbox               : L.LatLngBounds;
    private _tileLayerOptions   : L.TileLayerOptions;
    private _circleMarkerOptions: L.PathOptions;
    private _circleMarkerRadius : Number;

    constructor (id: string, options?: L.Map.MapOptions) {

        if (id === undefined) {
            console.log('You need to define the name of div element to put the leaflet map into.');
        }

        super(id, options);

        this.fitWorld();

        this._tileLayerOptions = {
            maxZoom: 18,
            attribution: 'Map data &copy; <a href=\'http://openstreetmap.org\'>OpenStreetMap</a> contributors, ' +
                '<a href=\'http://creativecommons.org/licenses/by-sa/2.0/\'>CC-BY-SA</a>, ' +
                'Imagery &copy; <a href=\'http://mapbox.com\'>Mapbox</a>',
            id: 'mapbox.streets',
            accessToken: '<KEY>'
        };
        this._circleMarkerOptions = {
            color: '#f20'
        };
        this.circleMarkerRadius = 12;

        L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', this._tileLayerOptions).addTo(this);

    }




    public binddata(data:IDataRow[]) {
        this._data = data;
        this._bbox = this.calcBoundingBox();
        this.setView([(this._bbox.getNorth() + this._bbox.getSouth()) / 2,
                      (this._bbox.getEast() + this._bbox.getWest()) / 2]);

        this.fitBounds(this._bbox);

    }




    public calcBoundingBox():L.LatLngBounds {

        let _latLngs: Array<L.LatLng> = [];

        for (let elem of this._data) {
            _latLngs.push(new L.LatLng(elem.latitude, elem.longitude));
        }
        return L.latLngBounds(_latLngs);
    }




    public showCrimeLocations() {

        for (let elem of this._data) {
            let pos = new L.LatLng(elem.latitude, elem.longitude);
            L.circleMarker(pos, this._circleMarkerOptions).setRadius(5).addTo(this);
        }
    }




    public set circleMarkerOptions(circleMarkerOptions:L.PathOptions) {
        this._circleMarkerOptions = circleMarkerOptions;
    }




    public get circleMarkerOptions():L.PathOptions {
        return this._circleMarkerOptions;
    }



<commit_msg>corrected what seemed to be an error with constructing leaflet latlong objects<commit_after>
/// <reference path="../../typings/tsd.d.ts" />


class Map extends L.Map {

    private _data               : IDataRow[];
    private _bbox               : L.LatLngBounds;
    private _tileLayerOptions   : L.TileLayerOptions;
    private _circleMarkerOptions: L.PathOptions;
    private _circleMarkerRadius : Number;

    constructor (id: string, options?: L.Map.MapOptions) {

        if (id === undefined) {
            console.log('You need to define the name of div element to put the leaflet map into.');
        }

        super(id, options);

        this.fitWorld();

        this._tileLayerOptions = {
            maxZoom: 18,
            attribution: 'Map data &copy; <a href=\'http://openstreetmap.org\'>OpenStreetMap</a> contributors, ' +
                '<a href=\'http://creativecommons.org/licenses/by-sa/2.0/\'>CC-BY-SA</a>, ' +
                'Imagery &copy; <a href=\'http://mapbox.com\'>Mapbox</a>',
            id: 'mapbox.streets',
            accessToken: '<KEY>'
        };
        this._circleMarkerOptions = {
            color: '#f20'
        };
        this.circleMarkerRadius = 12;

        L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', this._tileLayerOptions).addTo(this);

    }




    public binddata(data:IDataRow[]) {
        this._data = data;
        this._bbox = this.calcBoundingBox();
        this.setView([(this._bbox.getNorth() + this._bbox.getSouth()) / 2,
                      (this._bbox.getEast() + this._bbox.getWest()) / 2]);

        this.fitBounds(this._bbox);

    }




    public calcBoundingBox():L.LatLngBounds {

        let _latLngs: Array<L.LatLng> = [];

        for (let elem of this._data) {
            _latLngs.push(L.latLng(elem.latitude, elem.longitude));
        }
        return L.latLngBounds(_latLngs);
    }




    public showCrimeLocations() {

        for (let elem of this._data) {
            let pos = L.latLng(elem.latitude, elem.longitude);
            L.circleMarker(pos, this._circleMarkerOptions).setRadius(5).addTo(this);
        }
    }




    public set circleMarkerOptions(circleMarkerOptions:L.PathOptions) {
        this._circleMarkerOptions = circleMarkerOptions;
    }




    public get circleMarkerOptions():L.PathOptions {
        return this._circleMarkerOptions;
    }




{'fraction_non_alphanumeric': 0.13892969569779642, 'fraction_numerical': 0.005036726128016789, 'mean_word_length': 2.1562913907284766, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '6762592', 'n_tokens_mistral': 1553, 'n_tokens_neox': 1456, 'n_words': 263}