{"size": 1610, "ext": "js", "max_stars_repo_path": "static/js/one_leaflet.js", "max_stars_repo_name": "acdh-oeaw/tei2arche", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "static/js/one_leaflet.js", "max_issues_repo_name": "acdh-oeaw/tei2arche", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "static/js/one_leaflet.js", "max_forks_repo_name": "acdh-oeaw/tei2arche", "max_forks_repo_forks_event_min_datetime": "2021-12-14T11:17:06.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-14T11:17:06.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 44.7222222222, "max_line_length": 253, "alphanum_fraction": 0.6397515528}
// display map container
$('#leaflet-map-one').css({'display': 'flex'});
// leaflet map:
if (document.body.querySelectorAll('.map-coordinates').length !== 0) {
    var latStart = document.body.querySelectorAll('.map-coordinates')[0].getAttribute('lat');
    var longStart = document.body.querySelectorAll('.map-coordinates')[0].getAttribute('long');
    var mymap = L.map('leaflet-map-one').setView([latStart,longStart], 2);
} else {
    var mymap = L.map('leaflet-map-one').setView([48.250000000000, 16.399720000000], 4);
}

L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: 'Map data &amp;copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.openstreetmap.org/">OpenStreetMap</a>',
    maxZoom: 18,
    zIndex: 1
}).addTo(mymap);

//create labels for each coordinate existing lat long coordinate

if (document.body.querySelectorAll('.map-coordinates').length !== 0) {
    var markers = L.markerClusterGroup();
    document.body.querySelectorAll('.map-coordinates').forEach(function(node){
        if (node.getAttribute('lat').length != 0) {
            var lat = node.getAttribute('lat');
            var long = node.getAttribute('long');
            var place = node.getAttribute('subtitle');                    
            markers.addLayer(L.marker([lat,long]).bindPopup(place));
            }
        });
    markers.addTo(mymap);
    try {
        mymap.fitBounds(markers.getBounds());
    } catch (err) {
        console.log(err);
    }
}