<commit_before>var map = L.map('map', {
        zoomControl: false,
        attributionControl: false
    }
).setView([37,-108], 5);

// Basemaps
topographic=L.esri.basemapLayer("Topographic").addTo(map);
imagery=L.esri.basemapLayer("Imagery");
usa_topo=L.esri.basemapLayer("USATopo");
national_geographic=L.esri.basemapLayer("NationalGeographic");

var groupedOverlays = {
    "Base Maps": {
        'Topographic': topographic,
        'USA Topo': usa_topo,
        'National Geographic': national_geographic,
        'Imagery': imagery,
    },
    "Output Layers": {
    },
    "Input Layers": {
    },
};

var options = {
    position:"topleft",
    /*exclusiveGroups: ["Reporting Units","Base Maps", "Input Layers"]*/
};

layerControl = L.control.groupedLayers("", groupedOverlays, options).addTo(map);


function loadLayers(scenario_input_services){

    inputStateClassLayer = L.tileLayer(scenario_input_services.stateclass);
    inputStratumLayer = L.tileLayer(scenario_input_services.stratum);

    layerControl.addOverlay(inputStateClassLayer, "State Classes", "Input Layers");
    layerControl.addOverlay(inputStratumLayer, "Vegetation Types", "Input Layers");

    inputStratumLayer.addTo(map)

}

map.on('overlayadd', swapLegend);

function swapLegend(e){

    $("#scene_legend").empty();
    $("#scene_legend").append("<div class='legend_title'>" + e.name + "</div>");
    $.each(colorMap[e.name], function(key,value){
        $("#scene_legend").append("<div class='scene_legend_color' style='background-color:" + value + "'> &nbsp</div>" + key + "<br>")
    });
}

function loadOutputLayers(results_scenario_configuration){

    // Change it to the number of iterations
    // Change t to the min timestep

    map.removeLayer(inputStateClassLayer);
    map.removeLayer(inputStratumLayer);

    var t0it1 = {'t': 0, 'it': 1};

    if (typeof results_scenario_configuration.scenario_output_services.stateclass != "undefined") {

        var outputStateClassLayer = L.tileLayer(results_scenario_configuration.scenario_output_services.stateclass, t0it1).addTo(map).bringToFront();
        layerControl.addOverlay(outputStateClassLayer, "State Classes", "Output Layers");

        var timestep_slider = L.control.range({
            position: 'bottomright',<commit_msg>Bring input layer to the front when checked on.<commit_after>var map = L.map('map', {
        zoomControl: false,
        attributionControl: false
    }
).setView([37,-108], 5);

// Basemaps
topographic=L.esri.basemapLayer("Topographic").addTo(map);
imagery=L.esri.basemapLayer("Imagery");
usa_topo=L.esri.basemapLayer("USATopo");
national_geographic=L.esri.basemapLayer("NationalGeographic");

var groupedOverlays = {
    "Base Maps": {
        'Topographic': topographic,
        'USA Topo': usa_topo,
        'National Geographic': national_geographic,
        'Imagery': imagery,
    },
    "Output Layers": {
    },
    "Input Layers": {
    },
};

var options = {
    position:"topleft",
    /*exclusiveGroups: ["Reporting Units","Base Maps", "Input Layers"]*/
};

layerControl = L.control.groupedLayers("", groupedOverlays, options).addTo(map);


function loadLayers(scenario_input_services){

    inputStateClassLayer = L.tileLayer(scenario_input_services.stateclass);
    inputStratumLayer = L.tileLayer(scenario_input_services.stratum);

    layerControl.addOverlay(inputStateClassLayer, "State Classes", "Input Layers");
    layerControl.addOverlay(inputStratumLayer, "Vegetation Types", "Input Layers");

    inputStratumLayer.addTo(map)

}

map.on('overlayadd', overlayAdd);

function overlayAdd(e){
    var layer = e.layer;
    layer.bringToFront();

    $("#scene_legend").empty();
    $("#scene_legend").append("<div class='legend_title'>" + e.name + "</div>");
    $.each(colorMap[e.name], function(key,value){
        $("#scene_legend").append("<div class='scene_legend_color' style='background-color:" + value + "'> &nbsp</div>" + key + "<br>")
    });
}

function loadOutputLayers(results_scenario_configuration){

    // Change it to the number of iterations
    // Change t to the min timestep

    map.removeLayer(inputStateClassLayer);
    map.removeLayer(inputStratumLayer);

    var t0it1 = {'t': 0, 'it': 1};

    if (typeof results_scenario_configuration.scenario_output_services.stateclass != "undefined") {

        var outputStateClassLayer = L.tileLayer(results_scenario_configuration.scenario_output_services.stateclass, t0it1).addTo(map).bringToFront();
        layerControl.addOverlay(outputStateClassLayer, "State Classes", "Output Layers");

        var timestep_slider = L.control.range({
            position: 'bottomright',
{'fraction_non_alphanumeric': 0.14688778806805944, 'fraction_numerical': 0.005169071720870127, 'mean_word_length': 4.418903150525088, 'pattern_counts': {'":': 6, '<': 13, '<?xml version=': 0, '>': 13, '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': '1875359', 'n_tokens_mistral': 1542, 'n_tokens_neox': 1473, 'n_words': 253}