<commit_before>/*
 * @requires config.js
 */

/**
 * See http://docs.openlayers.org/library/feature_styling.html
 * This script configures how the features are styled on the map
 */

Ext.namespace("c2corg");

c2corg.styleMap = function (config) {

    config = config || {};
    var points = Ext.applyIf(config.points || {}, {
        pointRadius: 8,
        graphicOpacity: 1,
        externalGraphic: c2corg.config.staticBaseUrl + "/static/images/${icon}"
    }),
        lines = Ext.applyIf(config.lines || {}, {
            strokeColor: "yellow",
            strokeWidth: 2
        }),
        polygons = Ext.applyIf(config.polygons || {}, {
            strokeColor: "yellow",
            strokeWidth: 2,
            fillOpacity: 0
        }),
        pointsHover = Ext.applyIf({
            graphicOpacity: 0.6
        }, points),
        linesHover = Ext.applyIf({
            strokeColor: "red",
            strokeWidth: 3
        }, lines),
        polygonsHover = Ext.applyIf({
            strokeColor: "red",
            strokeWidth: 3
        }, polygons);

    /*
    // TODO: rename summits picto with names containing the "summit_type" attribute
    // or add an attribute that contains the name of the picto to use
    var summits = Ext.applyIf({
        externalGraphic: c2corg.config.staticBaseUrl + "/static/images/picto/summit_${summit_type}.png" 
    }, points);
    */
    
    var context = function (feature) {
        var attr = feature.attributes; 
        if (feature.geometry instanceof OpenLayers.Geometry.Point) {
            attr.icon = "modules/" + attr.module + "_mini.png";
            if (attr.module == "summits") {
                if (typeof attr.summit_type != "undefined") {
                    if (attr.summit_type == 2) attr.icon = "picto/pass.png";
                    if (attr.summit_type == 3) attr.icon = "picto/lake.png";
                    if (attr.summit_type == 4) attr.icon = "picto/crag.png";
                    // FIXME: other types?
                }
            } else if (attr.module == "parkings") {
                if (typeof attr.public_transportation_rating != "undefined") {
                    if (["1","2","4","5"].indexOf(attr.public_transportation_rating) != -1) {
                        attr.icon = "picto/parking_green.png";
                    }<commit_msg>when hovering a polygon, use a fill-color<commit_after>/*
 * @requires config.js
 */

/**
 * See http://docs.openlayers.org/library/feature_styling.html
 * This script configures how the features are styled on the map
 */

Ext.namespace("c2corg");

c2corg.styleMap = function (config) {

    config = config || {};
    var points = Ext.applyIf(config.points || {}, {
        pointRadius: 8,
        graphicOpacity: 1,
        externalGraphic: c2corg.config.staticBaseUrl + "/static/images/${icon}"
    }),
        lines = Ext.applyIf(config.lines || {}, {
            strokeColor: "yellow",
            strokeWidth: 2
        }),
        polygons = Ext.applyIf(config.polygons || {}, {
            strokeColor: "yellow",
            strokeWidth: 2,
            fillOpacity: 0
        }),
        pointsHover = Ext.applyIf({
            graphicOpacity: 0.6
        }, points),
        linesHover = Ext.applyIf({
            strokeColor: "red",
            strokeWidth: 3
        }, lines),
        polygonsHover = Ext.applyIf({
            strokeColor: "red",
            strokeWidth: 3,
            fillColor: "red",
            fillOpacity: .5
        }, polygons);

    /*
    // TODO: rename summits picto with names containing the "summit_type" attribute
    // or add an attribute that contains the name of the picto to use
    var summits = Ext.applyIf({
        externalGraphic: c2corg.config.staticBaseUrl + "/static/images/picto/summit_${summit_type}.png" 
    }, points);
    */
    
    var context = function (feature) {
        var attr = feature.attributes; 
        if (feature.geometry instanceof OpenLayers.Geometry.Point) {
            attr.icon = "modules/" + attr.module + "_mini.png";
            if (attr.module == "summits") {
                if (typeof attr.summit_type != "undefined") {
                    if (attr.summit_type == 2) attr.icon = "picto/pass.png";
                    if (attr.summit_type == 3) attr.icon = "picto/lake.png";
                    if (attr.summit_type == 4) attr.icon = "picto/crag.png";
                    // FIXME: other types?
                }
            } else if (attr.module == "parkings") {
                if (typeof attr.public_transportation_rating != "undefined") {
                    if (["1","2","4","5"].indexOf(attr.public_transportation_rating) != -1) {
                        attr.icon = "picto/parking_green.png";
                    }
{'fraction_non_alphanumeric': 0.13188436378982907, 'fraction_numerical': 0.00907364422874024, 'mean_word_length': 1.8163992869875223, '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': '5814781', 'n_tokens_mistral': 1427, 'n_tokens_neox': 1371, 'n_words': 306}