{"size": 2234, "ext": "js", "max_stars_repo_path": "web/js/sofien1.js", "max_stars_repo_name": "codexteamm/pidev_world-aid", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "web/js/sofien1.js", "max_issues_repo_name": "codexteamm/pidev_world-aid", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "web/js/sofien1.js", "max_forks_repo_name": "codexteamm/pidev_world-aid", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.2708333333, "max_line_length": 104, "alphanum_fraction": 0.5398388541}
/*let $map = document.querySelector('#map1');

class LeafletMap {
    constructor() {
        this.map=null;
    }

    async load(element) {
        return new Promise((resolve, reject) => {
            $script('https://unpkg.com/leaflet@1.3.1/dist/leaflet.js', function () {
                console.log(element)
                //console.log(L.map(element))
                console.log(this.map)
                this.map = L.map(element)

                resolve()


            })
        })

    }

    addMarker(lat, lng, text) {
        L.popup({
            autoClose: false,
            closeOnEscapeKey: false,
            closeOnClick: false,
            closeButton: false,
            className: 400

        })
            .setLatLng([lat, lng])
            .openOn(this.map)

    }


}

const initMap = async function () {
    let map = new LeafletMap()
    await map.load($map);
    Array.from(document.querySelectorAll('.card').forEach((item) => {
        map.addMarker(item.dataset.lat, item.dataset.lng)
    }))


};
if ($map != null) {
    initMap()
}*/
var map = L.map('map1').setView([36.527294814546,10.5029296875], 9);
L.tileLayer('http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png').addTo(map); //will be our basemap.
function addpopup(lat,lan,desc){
    console.log(lat , lan , desc)
    map.panTo([lat,lan]);
    L.popup({
        autoClose: false,
        closeOnEscapeKey : false,
        closeOnClick: false,
        closeButton: false,
        className: 'marker',
        maxWidth:400

    })
        .setLatLng([lat, lan])
        .setContent(desc)
        .openOn(map);



}

Array.from(document.querySelectorAll('.card-body')).forEach((item) => {
    //console.log(item.dataset.lat, item.dataset.lng)

    item.addEventListener('click',function () {
        console.log(item.dataset.lat, item.dataset.lng, item.dataset.desc )
        addpopup(item.dataset.lat, item.dataset.lng,item.dataset.desc)


    })
})
$(".filter").on("keyup", function() {
    var input = $(this).val().toUpperCase();

    $(".col-sm-5").each(function() {
        if ($(this).data("string").toUpperCase().indexOf(input) < 0) {
            $(this).hide();
        } else {
            $(this).show();
        }
    })
});
