<commit_before>var markers = new Array();

function initMap() {
	// Die Karte wird in der index-html in das Div mit der id "mymap" gezeichnet
	map = new L.Map("map");
	
	var min = 10; //minimale Zoomstufe
	var max = 15; //maximale Zoomstufe	
	var myTiles = "http://tiles.jochenklar.de/pinkoding-bbs/{z}/{x}/{y}.png";
	
        osmCopyright = "Map data &copy; 2012 OpenStreetMap contributors"; //Copyrigth, das unten rechts erscheint	
	myLayer = new L.TileLayer(myTiles, { minZoom:min, maxZoom: max, attribution: osmCopyright, zIndex:0, reuseTiles:true } ); //Nun wird mit diesen tiles eine ebene erstellt (hier gibt es nur eine Ebene, es sind aber auch mehrere Ebenen möglich)	
	map.addLayer( myLayer ); //Füge die Ebene der Karte hinzu			
	
	var center = new L.LatLng(52.51, 13.37628); //Fokus der Karte	
	map.setView(center, 11);		
	
	var orangeIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/klein/schild_organge_klein.png',    
        iconSize:     [26, 45], // size of the icon width,height    
        iconAnchor:   [13, 45], // point of the icon which will correspond to marker's location    
        popupAnchor:  [0, -46] // point from which the popup should open relative to the iconAnchor
	});
    var markedIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/groß/schild_organge_groß.png',    
        iconSize:     [35, 65], // size of the icon width,height    
        iconAnchor:   [17, 65], // point of the icon which will correspond to marker's location       
	});

    // bbps zu karte hinzufügen
    $.each(bbps, function(key,bbp){
        var text = bbp.fields.address; 
        var bezirk = bbp.fields.bezirk;
        var typid = bbp.fields.typ;        
        var typ = typen[typid-1].fields.name;
        var end = bbp.fields.end;
        var link = siteUrl + "bbp/" + bbp.pk ;

        // marker für leaflet karte
        var marker = L.marker(
            [bbp.fields.lat,bbp.fields.lon],
            {icon: orangeIcon}
        ).addTo(map);

        marker.pk = bbp.pk;

        marker.on('mouseover', function(evt) {
            $('a', '#bbp-' + this.pk).addClass("marked");
            //$('#typ'+ typid).css("background-color", "#de6a00");  
            $('#typ'+ typid).addClass("listentry-marked");    
            
            //markers[this.pk].setIcon(markedIcon);
        });
        marker.on('mouseout', function(evt) {
            $('a', '#bbp-' + this.pk).removeClass("marked");
            $('#typ'+ typid).removeClass("listentry-marked");
            //$('#typ'+ typid).css("background-color", "transparent"); 
            //markers[this.pk].setIcon(orangeIcon);
        });

        var popuptext = typ;
        popuptext += '<br>';
        popuptext += "Beteiligung möglich bis: " + end;
        popuptext += '<br>';
        popuptext += '<a href="' + link + '" target="blank">Details</a>';
        marker.bindPopup(popuptext);

        // add marker to global marker array
        markers[bbp.pk] = marker;

        // listeneintrag für sidebar
        var li = $('<li/>',{
            'id': 'bbp-'+ bbp.pk,
            'html': '<a href="' + link + '" target="blank">Betrifft die Gegend um: ' + '<b>' +text + '</b> in ' + bezirke[bezirk-1].fields.name +'</a>'
        }).appendTo($('ul', '#sidebar-content'));

        // mouseover effekte für listeneintrag
        li.mouseover(function() {
            var pk = $(this).attr('id').split('bbp-')[1];
            $('a', this).addClass("marked");
            markers[pk].setIcon(markedIcon);
        });
        li.mouseout(function() {
            var pk = $(this).attr('id').split('bbp-')[1];
            $('a', this).removeClass("marked");
            markers[pk].setIcon(orangeIcon);
        });
    }); 
    
    /*var greyIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/klein/schild_grau_klein.png',    
        iconSize:     [26, 45], // size of the icon width,height    
        iconAnchor:   [13, 45], // point of the icon which will correspond to marker's location    
        popupAnchor:  [0, -46] // point from which the popup should open relative to the iconAnchor
	});
    var markedGreyIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/groß/schild_grau_groß.png',    <commit_msg>info karte interaktion<commit_after>var markers = new Array();

function initMap() {
	// Die Karte wird in der index-html in das Div mit der id "mymap" gezeichnet
	map = new L.Map("map");
	
	var min = 10; //minimale Zoomstufe
	var max = 15; //maximale Zoomstufe	
	var myTiles = "http://tiles.jochenklar.de/pinkoding-bbs/{z}/{x}/{y}.png";
	
        osmCopyright = "Map data &copy; 2012 OpenStreetMap contributors"; //Copyrigth, das unten rechts erscheint	
	myLayer = new L.TileLayer(myTiles, { minZoom:min, maxZoom: max, attribution: osmCopyright, zIndex:0, reuseTiles:true } ); //Nun wird mit diesen tiles eine ebene erstellt (hier gibt es nur eine Ebene, es sind aber auch mehrere Ebenen möglich)	
	map.addLayer( myLayer ); //Füge die Ebene der Karte hinzu			
	
	var center = new L.LatLng(52.51, 13.37628); //Fokus der Karte	
	map.setView(center, 11);		
	
	var orangeIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/klein/schild_organge_klein.png',    
        iconSize:     [26, 45], // size of the icon width,height    
        iconAnchor:   [13, 45], // point of the icon which will correspond to marker's location    
        popupAnchor:  [0, -46] // point from which the popup should open relative to the iconAnchor
	});
    var markedIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/groß/schild_organge_groß.png',    
        iconSize:     [35, 65], // size of the icon width,height    
        iconAnchor:   [17, 65], // point of the icon which will correspond to marker's location       
	});

    // bbps zu karte hinzufügen
    $.each(bbps, function(key,bbp){
        var text = bbp.fields.address; 
        var bezirk = bbp.fields.bezirk;
        var typid = bbp.fields.typ;        
        var typ = typen[typid-1].fields.name;
        var end = bbp.fields.end;
        var link = siteUrl + "bbp/" + bbp.pk ;

        // marker für leaflet karte
        var marker = L.marker(
            [bbp.fields.lat,bbp.fields.lon],
            {icon: orangeIcon}
        ).addTo(map);

        marker.pk = bbp.pk;

        marker.on('mouseover', function(evt) {
            $('a', '#bbp-' + this.pk).addClass("marked");
            //$('#typ'+ typid).css("background-color", "#de6a00");  
            //$('#typ'+ typid).addClass("listentry-marked");    
            
            //markers[this.pk].setIcon(markedIcon);
        });
        marker.on('mouseout', function(evt) {
            $('a', '#bbp-' + this.pk).removeClass("marked");
            //$('#typ'+ typid).removeClass("listentry-marked");
            //$('#typ'+ typid).css("background-color", "transparent"); 
            //markers[this.pk].setIcon(orangeIcon);
        });
        
        marker.on('click', function(evt) {            
            $('#typ'+ typid).addClass("listentry-marked");
            //$('#typ'+ typid).css("background-color", "transparent"); 
            //markers[this.pk].setIcon(orangeIcon);
        });
        
        

        var popuptext = typ;
        popuptext += '<br>';
        popuptext += "Beteiligung möglich bis: " + end;
        popuptext += '<br>';
        popuptext += '<a href="' + link + '" target="blank">Details</a>';
        marker.bindPopup(popuptext);
        
        map.addEventListener('popupclose', function() { $('.listentry-marked').removeClass('listentry-marked');}, this);

        // add marker to global marker array
        markers[bbp.pk] = marker;

        // listeneintrag für sidebar
        var li = $('<li/>',{
            'id': 'bbp-'+ bbp.pk,
            'html': '<a href="' + link + '" target="blank">Betrifft die Gegend um: ' + '<b>' +text + '</b> in ' + bezirke[bezirk-1].fields.name +'</a>'
        }).appendTo($('ul', '#sidebar-content'));

        // mouseover effekte für listeneintrag
        li.mouseover(function() {
            var pk = $(this).attr('id').split('bbp-')[1];
            $('a', this).addClass("marked");
            markers[pk].setIcon(markedIcon);
        });
        li.mouseout(function() {
            var pk = $(this).attr('id').split('bbp-')[1];
            $('a', this).removeClass("marked");
            markers[pk].setIcon(orangeIcon);
        });
    }); 
    
    /*var greyIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/klein/schild_grau_klein.png',    
        iconSize:     [26, 45], // size of the icon width,height    
        iconAnchor:   [13, 45], // point of the icon which will correspond to marker's location    
        popupAnchor:  [0, -46] // point from which the popup should open relative to the iconAnchor
	});
    var markedGreyIcon = L.icon({
        iconUrl: staticUrl + '/img/Baustellenschilder/groß/schild_grau_groß.png',    
{'fraction_non_alphanumeric': 0.15807675145024544, 'fraction_numerical': 0.013163766175814369, 'mean_word_length': 2.2540834845735027, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '2302369', 'n_tokens_mistral': 3047, 'n_tokens_neox': 2876, 'n_words': 698}