<commit_before>define([
    'agrc/widgets/map/BaseMap',

    'app/config',

    'dojo/Deferred',
    'dojo/on',
    'dojo/topic',
    'dojo/_base/lang',

    'esri/Color',
    'esri/geometry/Extent',
    'esri/graphic',
    'esri/layers/ArcGISDynamicMapServiceLayer',
    'esri/layers/ArcGISTiledMapServiceLayer',
    'esri/layers/FeatureLayer',
    'esri/tasks/IdentifyParameters',
    'esri/tasks/IdentifyTask',
    'esri/tasks/query',
    'esri/tasks/QueryTask',

    'layer-selector/LayerSelector'
], function (
    BaseMap,

    config,

    Deferred,
    on,
    topic,
    lang,

    Color,
    Extent,
    Graphic,
    ArcGISDynamicMapServiceLayer,
    ArcGISTiledMapServiceLayer,
    FeatureLayer,
    IdentifyParameters,
    IdentifyTask,
    Query,
    QueryTask,

    LayerSelector
) {
    return {
        // map: BaseMap
        map: null,

        // dLayer: ArcGISDynamicMapServiceLayer
        //      layer that is displayed at smaller scales
        dLayer: null,

        // fLayer: FeatureLayer
        //      layer that is displayed at larger scales
        fLayer: null,

        // layerEventHandlers: Object[]
        layerEventHandlers: [],

        // identifyTask: IdentifyTask
        identifyTask: null,

        // selectedStationId: Number
        //      The id of the currently selected station if there is one
        selectedStationId: null,

        // mapClickHandler: Object
        //      Used to pause this event during polygon draw
        mapClickHandler: null,

        securityLevels: {
            open: 'open',
            secure: 'secure'
        },

        initMap: function (mapDiv, securityLevel) {
            // summary:
            //      Sets up the map
            // mapDiv: Node
            // securityLevel: string
            console.info('app/mapController:initMap', arguments);

            var that = this;

            this.map = new BaseMap(mapDiv, {
                useDefaultBaseMap: false,
                extent: new Extent({
                    xmax: -11762120.612131765,
                    xmin: -13074391.513731329,
                    ymax: 5225035.106177688,
                    ymin: 4373832.359194187,
                    spatialReference: {
                        wkid: 3857
                    }
                })
            });
            var ls = new LayerSelector({
                map: this.map,
                quadWord: config.quadWord,
                baseLayers: [
                'Hybrid',
                'Terrain',
                'Topo',
                {
                    url: config.urls.esriStreets,
                    Factory: ArcGISTiledMapServiceLayer,
                    id: 'ESRI Streets'
                }]
            });
            ls.startup();

            this.initLayers(securityLevel);

            topic.subscribe(config.topics.filterFeatures, lang.hitch(this, 'filterFeatures'));
            topic.subscribe(config.topics.addGraphic, function (geo) {
                that.map.graphics.clear();
                that.map.graphics.add(new Graphic(geo, config.drawingSymbol));
            });
            topic.subscribe(config.topics.removeGraphic, function () {
                that.map.graphics.clear();
            });
            topic.subscribe(config.topics.clearStationSelection, lang.hitch(this, 'clearStationSelection'));

            this.mapClickHandler = on.pausable(this.map, 'click', lang.hitch(this, 'onMapClick'));
            topic.subscribe(config.topics.pauseMapClick, lang.hitch(this.mapClickHandler, 'pause'));
            topic.subscribe(config.topics.resumeMapClick, lang.hitch(this.mapClickHandler, 'resume'));
        },<commit_msg>switch default basemap to esri streets<commit_after>define([
    'agrc/widgets/map/BaseMap',

    'app/config',

    'dojo/Deferred',
    'dojo/on',
    'dojo/topic',
    'dojo/_base/lang',

    'esri/Color',
    'esri/geometry/Extent',
    'esri/graphic',
    'esri/layers/ArcGISDynamicMapServiceLayer',
    'esri/layers/ArcGISTiledMapServiceLayer',
    'esri/layers/FeatureLayer',
    'esri/tasks/IdentifyParameters',
    'esri/tasks/IdentifyTask',
    'esri/tasks/query',
    'esri/tasks/QueryTask',

    'layer-selector/LayerSelector'
], function (
    BaseMap,

    config,

    Deferred,
    on,
    topic,
    lang,

    Color,
    Extent,
    Graphic,
    ArcGISDynamicMapServiceLayer,
    ArcGISTiledMapServiceLayer,
    FeatureLayer,
    IdentifyParameters,
    IdentifyTask,
    Query,
    QueryTask,

    LayerSelector
) {
    return {
        // map: BaseMap
        map: null,

        // dLayer: ArcGISDynamicMapServiceLayer
        //      layer that is displayed at smaller scales
        dLayer: null,

        // fLayer: FeatureLayer
        //      layer that is displayed at larger scales
        fLayer: null,

        // layerEventHandlers: Object[]
        layerEventHandlers: [],

        // identifyTask: IdentifyTask
        identifyTask: null,

        // selectedStationId: Number
        //      The id of the currently selected station if there is one
        selectedStationId: null,

        // mapClickHandler: Object
        //      Used to pause this event during polygon draw
        mapClickHandler: null,

        securityLevels: {
            open: 'open',
            secure: 'secure'
        },

        initMap: function (mapDiv, securityLevel) {
            // summary:
            //      Sets up the map
            // mapDiv: Node
            // securityLevel: string
            console.info('app/mapController:initMap', arguments);

            var that = this;

            this.map = new BaseMap(mapDiv, {
                useDefaultBaseMap: false,
                extent: new Extent({
                    xmax: -11762120.612131765,
                    xmin: -13074391.513731329,
                    ymax: 5225035.106177688,
                    ymin: 4373832.359194187,
                    spatialReference: {
                        wkid: 3857
                    }
                })
            });
            var ls = new LayerSelector({
                map: this.map,
                quadWord: config.quadWord,
                baseLayers: [
                    {
                        url: config.urls.esriStreets,
                        Factory: ArcGISTiledMapServiceLayer,
                        id: 'ESRI Streets'
                    },
                    'Hybrid',
                    'Terrain',
                    'Topo'
                ]
            });
            ls.startup();

            this.initLayers(securityLevel);

            topic.subscribe(config.topics.filterFeatures, lang.hitch(this, 'filterFeatures'));
            topic.subscribe(config.topics.addGraphic, function (geo) {
                that.map.graphics.clear();
                that.map.graphics.add(new Graphic(geo, config.drawingSymbol));
            });
            topic.subscribe(config.topics.removeGraphic, function () {
                that.map.graphics.clear();
            });
            topic.subscribe(config.topics.clearStationSelection, lang.hitch(this, 'clearStationSelection'));

            this.mapClickHandler = on.pausable(this.map, 'click', lang.hitch(this, 'onMapClick'));
            topic.subscribe(config.topics.pauseMapClick, lang.hitch(this.mapClickHandler, 'pause'));
            topic.subscribe(config.topics.resumeMapClick, lang.hitch(this.mapClickHandler, 'resume'));
        },
{'fraction_non_alphanumeric': 0.10339256865912763, 'fraction_numerical': 0.01884760366182014, 'mean_word_length': 1.5894039735099337, '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': '629182', 'n_tokens_mistral': 2214, 'n_tokens_neox': 2017, 'n_words': 379}