<commit_before>const Map = L.Class.extend({
    initialize(map) {
        this.map = map;
        this.Draw = new L.PM.Draw(map);
        this.Toolbar = new L.PM.Toolbar(map);
    },
    addControls(options) {
        this.Toolbar.addControls(options);
    },
    removeControls() {
        this.Toolbar.removeControls();
    },
    toggleControls() {
        this.Toolbar.toggleControls();
    },
    controlsVisible() {
        return this.Toolbar.isVisible;
    },
    enableDraw(shape = 'Poly', options) {
        this.Draw.enable(shape, options);
    },
    disableDraw(shape = 'Poly') {
        this.Draw.disable(shape);
    },
    setPathOptions(options) {
        this.Draw.setPathOptions(options);
    },
    removeLayer(e) {
        const layer = e.target;
        if(!layer._layers && !layer.pm.dragging()) {
            e.target.remove();
        }
    },
    toggleGlobalRemovalMode() {
        // toggle global edit mode
        if(this.globalRemovalEnabled()) {
            this._globalRemovalMode = false;
            this.map.eachLayer((layer) => {
                layer.off('click', this.removeLayer);
            });
        } else {
            this._globalRemovalMode = true;
            this.map.eachLayer((layer) => {
                layer.on('click', this.removeLayer);
            });
        }

        // toogle the button in the toolbar
        this.Toolbar.toggleButton('deleteLayer', this._globalRemovalMode);
    },<commit_msg>fixed a bug where circleMarkers couldn't be removed<commit_after>const Map = L.Class.extend({
    initialize(map) {
        this.map = map;
        this.Draw = new L.PM.Draw(map);
        this.Toolbar = new L.PM.Toolbar(map);
    },
    addControls(options) {
        this.Toolbar.addControls(options);
    },
    removeControls() {
        this.Toolbar.removeControls();
    },
    toggleControls() {
        this.Toolbar.toggleControls();
    },
    controlsVisible() {
        return this.Toolbar.isVisible;
    },
    enableDraw(shape = 'Poly', options) {
        this.Draw.enable(shape, options);
    },
    disableDraw(shape = 'Poly') {
        this.Draw.disable(shape);
    },
    setPathOptions(options) {
        this.Draw.setPathOptions(options);
    },
    removeLayer(e) {
        const layer = e.target;
        if(!layer._layers && (!layer.pm || !layer.pm.dragging())) {
            e.target.remove();
        }
    },
    toggleGlobalRemovalMode() {
        // toggle global edit mode
        if(this.globalRemovalEnabled()) {
            this._globalRemovalMode = false;
            this.map.eachLayer((layer) => {
                layer.off('click', this.removeLayer);
            });
        } else {
            this._globalRemovalMode = true;
            this.map.eachLayer((layer) => {
                layer.on('click', this.removeLayer);
            });
        }

        // toogle the button in the toolbar
        this.Toolbar.toggleButton('deleteLayer', this._globalRemovalMode);
    },
{'fraction_non_alphanumeric': 0.1391040754462782, 'fraction_numerical': 0.0, 'mean_word_length': 1.9261083743842364, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7514015', 'n_tokens_mistral': 853, 'n_tokens_neox': 857, 'n_words': 134}