window.onload = function () { index = 0 var map = L.map('map',{ minZoom: 2, maxZoom:6, zoomControl:false }).setView(latlong[index], 4); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); //setting the controls: new L.Control.Zoom({ position: 'topright'} ).addTo(map) //custom markers: var customIcon = L.icon({ iconUrl: 'images/marker-icon.png', iconSize: [20, 20], // size of the icon iconAnchor: [10, 10], // point of the icon which will correspond to marker's location popupAnchor: [-200, 200] // point from which the popup should open relative to the iconAnchor }); //the slider bar $('.info').hide() slide = 0 $('#button').bind('click', function(){ if (slide == 0){ $('.bar').animate({"width": '300'}) $('.info').show() $('#button').html('<') } slide += 1 if (slide == 2){ $('.bar').animate({"width": '20'}) $('.info').hide() $('#button').html('>') slide = 0} }) //function chain for drawing the markers and lines on the map. delay = (100+timestamp_list[index]) //sets the animationspeed clusterGroups = {} //contains all country specific clusters makeClusterGroups(country_code_list, index) //initialize first cluster AddStep(latlong[index], latlong[index+1], index) // initialize the animation function makeClusterGroups(country_code_list, index){ for (var i = 0; i < unique_country_code_list.length; i++){ if (unique_country_code_list[i] == country_code_list[index]){ if (clusterGroups[unique_country_code_list[i]]){ //checks if a cluster for the country already exists return } else //if not make it. clusterGroups[unique_country_code_list[i]] = new L.MarkerClusterGroup(); } } } //console.log(clusterGroups) function AddMarkerCluster(marker, index){ clusterGroups[country_code_list[index]].addLayer(marker) map.addLayer(clusterGroups[country_code_list[index]]) } function AddMarker(src, index){ makeClusterGroups(country_code_list, index) var marker = L.marker([src[0], src[1]],{icon: customIcon}) var popup = L.Popup({ maxHeight: 50}) var popupcontent = "
Hop no:"+hop_list[index]+"
Server name:
"+server_name_list[index]+"
Network owner:
"+asn_list[index]+"