<commit_before>/*
 guidepost check from OsmHiCheck for osmcz
 Javascript code for openstreetmap.cz website
 Copyright (C) 2015-2021

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 https://github.com/osmcz/osmcz

 */

var osmcz = osmcz || {};
osmcz.gpcheck = function (map, baseLayers, overlays, controls, group) {
    // -- constructor --

    var layersControl = controls.layers;
    var xhr;
    var check_markers = L.markerClusterGroup({
        code: 'B',
        chunkedLoading: true,
        chunkProgress: update_progress_bar
    });
    var autoload_lock = false;
    var photoGuiForm = L.control.photoDbGui();
    var gpref, gpname;
    var openPopup;

    var gp_check_icon = L.icon({
        iconUrl: osmcz.basePath + "img/gp_check_missing.png",
        iconSize: [48, 48],
        iconAnchor: [23, 45]
    });
    var gp_check_noref_icon = L.icon({
        iconUrl: osmcz.basePath + "img/gp_check_noref.png",
        iconSize: [48, 48],
        iconAnchor: [23, 45]
    });
    var gp_check_noimg_icon = L.icon({
        iconUrl: osmcz.basePath + "img/gp_check_noimg.png",
        iconSize: [48, 48],
        iconAnchor: [23, 45]
    });
    var gp_check_tourism_icon = L.icon({
        iconUrl: osmcz.basePath + "img/gp_check_tourism.png",
        iconSize: [48, 48],
        iconAnchor: [23, 45]
    });

    var layer_gpcheck = new L.GeoJSON(null, {
        onEachFeature: function (feature, layer) {

            // Choose right icon
            if (feature.properties.class == "noref") {
                layer.setIcon(gp_check_noref_icon);
            } else if (feature.properties.class == "noimg") {
                layer.setIcon(gp_check_noimg_icon);
            } else if(feature.properties.class == "tourism"){
                layer.setIcon(gp_check_tourism_icon);
            } else {
                layer.setIcon(gp_check_icon);
            }

            // Guidepost name
            var html_content = '<div class="gp-check-popup" id="' + feature.id + '"><h6>' + feature.properties.name + '</h6>';

            // Missing image button including upload form
            var osmid = feature.id;
            var lat = feature.geometry.coordinates[1];
            var lon = feature.geometry.coordinates[0];
            html_content += '<div id="gpc-upload-img">';
            html_content += '  <button id="gpc-upload-btn" type="button" class="btn btn-info fa-4x center-block" onclick="osmcz.gpcheck.openForm(' + osmid + ');return false;" title="Máte fotografii? Vložte ji prosím.">';
            html_content += '     <div class="glyphicon glyphicon-plus-sign no-foto vcenter"></div><span style="margin-left: 10px"><strong>Vložit fotografii</strong></span>';
            html_content += '  </button>';
            html_content += '</div>';
<commit_msg>add different OsmHiCheck icons per OSM object type<commit_after>/*
 guidepost check from OsmHiCheck for osmcz
 Javascript code for openstreetmap.cz website
 Copyright (C) 2015-2021

 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.

 https://github.com/osmcz/osmcz

 */

var osmcz = osmcz || {};
osmcz.gpcheck = function (map, baseLayers, overlays, controls, group) {
    // -- constructor --

    var layersControl = controls.layers;
    var xhr;
    var check_markers = L.markerClusterGroup({
        code: 'B',
        chunkedLoading: true,
        chunkProgress: update_progress_bar
    });
    var autoload_lock = false;
    var photoGuiForm = L.control.photoDbGui();
    var gpref, gpname;
    var openPopup;

    var gp_check_icon = L.icon({
        iconUrl: osmcz.basePath + "img/gp_check_missing.png",
        iconSize: [48, 48],
        iconAnchor: [23, 45]
    });
    var gp_check_noref_icon = L.icon({
        iconUrl: osmcz.basePath + "img/gp_check_noref.png",
        iconSize: [48, 48],
        iconAnchor: [23, 45]
    });
    var gp_check_noimg_icon = L.icon({
        iconUrl: osmcz.basePath + "img/gp_check_noimg.png",
        iconSize: [48, 48],
        iconAnchor: [23, 45]
    });

    //-------------------------------
    var gp_check_miss_hiking_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/guidepost.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_hiking_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/guidepost.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_hiking_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/guidepost.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var gp_check_miss_cyklo_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/cycle.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_cyklo_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/cycle.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_cyklo_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/cycle.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var gp_check_miss_ski_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/ski.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_ski_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/ski.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_ski_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/ski.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var gp_check_miss_wheelchair_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/wheelchair.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_wheelchair_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/wheelchair.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_wheelchair_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/wheelchair.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var gp_check_miss_horse_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/horse.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_horse_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/horse.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_horse_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/horse.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var gp_check_miss_infopane_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/infopane.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_infopane_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/infopane.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_infopane_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/infopane.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var gp_check_miss_map_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/map.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_map_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/map.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_map_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/map.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var gp_check_miss_emergency_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-missing/emergency_point.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noimg_emergency_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noimg/emergency_point.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    var gp_check_noref_emergency_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36-noref/emergency_point.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });
    //-------------------------------
    var gp_check_tourism_icon = L.icon({
        iconUrl: osmcz.basePath + "img/icons36/tourism.png",
        iconSize: [36, 36],
        iconAnchor: [18, 35]
    });

    var layer_gpcheck = new L.GeoJSON(null, {
        onEachFeature: function (feature, layer) {

            // Choose right icon
            if (feature.properties.class == "noref") {
                layer.setIcon(gp_check_noref_icon);
            } else if (feature.properties.class == "noimg") {
                layer.setIcon(gp_check_noimg_icon);
            } else if(feature.properties.class == "tourism"){
                layer.setIcon(gp_check_tourism_icon);
            } else {
                layer.setIcon(gp_check_icon);
            }

            //Choose the right icon based on object type
            if (feature.properties.osm_tags.indexOf("information:board") > -1){
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_infopane_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_infopane_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_infopane_icon);
              }
            } else if (feature.properties.osm_tags.indexOf("information:map") > -1){
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_map_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_map_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_map_icon);
              }
            } else if (feature.properties.osm_tags.indexOf("emergency_access_point") > -1){
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_emergency_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_emergency_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_emergency_icon);
              }
            } else if (feature.properties.osm_tags.indexOf("information:guidepost") > -1 && feature.properties.osm_tags.indexOf("hiking") > -1){
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_hiking_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_hiking_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_hiking_icon);
              }
            } else if (feature.properties.osm_tags.indexOf("information:guidepost") > -1 &&
                       (feature.properties.osm_tags.indexOf("bicycle") > -1 || feature.properties.osm_tags.indexOf("mtb") > -1) ){  
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_cyklo_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_cyklo_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_cyklo_icon);
              }
            } else if (feature.properties.osm_tags.indexOf("information:guidepost") > -1 && feature.properties.osm_tags.indexOf("ski") > -1){
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_ski_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_ski_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_ski_icon);
              }
            } else if (feature.properties.osm_tags.indexOf("information:guidepost") > -1 && feature.properties.osm_tags.indexOf("wheelchair") > -1){
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_wheelchair_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_wheelchair_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_wheelchair_icon);
              }
            } else if (feature.properties.osm_tags.indexOf("information:guidepost") > -1 && feature.properties.osm_tags.indexOf("horse") > -1){
              if(feature.properties.class == "missing"){
                layer.setIcon(gp_check_miss_horse_icon);
              } else if (feature.properties.class == "noref"){
                layer.setIcon(gp_check_noref_horse_icon);
              } else if (feature.properties.class == "noimg"){
                layer.setIcon(gp_check_noimg_horse_icon);
              }
            }

            // Guidepost name
            var html_content = '<div class="gp-check-popup" id="' + feature.id + '"><h6>' + feature.properties.name + '</h6>';

            // Missing image button including upload form
            var osmid = feature.id;
            var lat = feature.geometry.coordinates[1];
            var lon = feature.geometry.coordinates[0];
            html_content += '<div id="gpc-upload-img">';
            html_content += '  <button id="gpc-upload-btn" type="button" class="btn btn-info fa-4x center-block" onclick="osmcz.gpcheck.openForm(' + osmid + ');return false;" title="Máte fotografii? Vložte ji prosím.">';
            html_content += '     <div class="glyphicon glyphicon-plus-sign no-foto vcenter"></div><span style="margin-left: 10px"><strong>Vložit fotografii</strong></span>';
            html_content += '  </button>';
            html_content += '</div>';

{'fraction_non_alphanumeric': 0.13071981119706305, 'fraction_numerical': 0.023075914514225776, 'mean_word_length': 2.324253650032687, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 45, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1146912', 'n_tokens_mistral': 5241, 'n_tokens_neox': 4751, 'n_words': 1018}