@ -0,0 +1,70 @@ |
|||
window.onload = function () { |
|||
var map = L.map('map',{ |
|||
minZoom: 2, |
|||
maxZoom:5, |
|||
|
|||
}).setView([38.0, -97.0], 3); |
|||
|
|||
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { |
|||
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' |
|||
}).addTo(map); |
|||
|
|||
//the slider bar
|
|||
$('#button').bind('click', function(){ |
|||
$('#bar').animate({"width": '200'}) |
|||
var info = $("<div id = info><p>this is where info goes</p><p>I will make a 'slide back' option later</p></div>") |
|||
.appendTo("#bar") |
|||
console.log('click') |
|||
|
|||
}) |
|||
|
|||
//function chain for drawing the markers and lines on the map.
|
|||
index = 0 |
|||
delay = (400+timestamp_list[index]) |
|||
|
|||
AddStep(latlong[index], latlong[index+1], index) |
|||
|
|||
function AddMarker(src, index){ |
|||
var marker = L.marker([src[0], src[1]]).bindPopup( |
|||
"<p>Hop no:"+hop_list[index]+"<br /><a>show metadata</a></p><p id=metadata'>Server name:<br />"+server_name_list[index]+"<br />Network owner:<br />"+asn_list[index]+"</p>" |
|||
); |
|||
marker.addTo(map).openPopup() |
|||
} |
|||
|
|||
function AddStep(src, dest, index){ |
|||
var b = new R.BezierAnim([src, dest], {}) |
|||
map.addLayer(b) |
|||
AddMarker(src, index) |
|||
processStep(index) |
|||
//console.log(delay)
|
|||
} |
|||
|
|||
function processStep (index) { |
|||
map.panTo(latlong[index]); |
|||
if (index < counter_max-2) { |
|||
//console.log('hop#', hop_list[index])
|
|||
changeFavicon('js/world/'+country_code_list[index]+'.png') |
|||
window.setTimeout(function () { |
|||
AddStep(latlong[index], latlong[index+1], index) |
|||
}, delay);} |
|||
else |
|||
if (index < counter_max-1){ |
|||
//console.log('hop#', hop_list[index])
|
|||
changeFavicon('js/world/'+country_code_list[index]+'.png') |
|||
window.setTimeout(function () { |
|||
AddStep(latlong[index], latlong[index], index) |
|||
}, delay);} |
|||
|
|||
else |
|||
if (index = counter_max-1){ |
|||
changeFavicon('js/world/'+country_code_list[index]+'.png') |
|||
//console.log('fin')
|
|||
//map.fitBounds([bounds])
|
|||
|
|||
} |
|||
|
|||
index = index + 1 |
|||
delay = (400 + timestamp_list[index]) |
|||
} |
|||
}; |
|||
|
@ -0,0 +1,20 @@ |
|||
/*! |
|||
* Dynamically changing favicons with JavaScript |
|||
* Works in all A-grade browsers except Safari and Internet Explorer |
|||
* Demo: http://mathiasbynens.be/demo/dynamic-favicons
|
|||
*/ |
|||
|
|||
// HTML5™, baby! http://mathiasbynens.be/notes/document-head
|
|||
document.head = document.head || document.getElementsByTagName('head')[0]; |
|||
|
|||
function changeFavicon(src) { |
|||
var link = document.createElement('link'), |
|||
oldLink = document.getElementById('dynamic-favicon'); |
|||
link.id = 'dynamic-favicon'; |
|||
link.rel = 'shortcut icon'; |
|||
link.href = src; |
|||
if (oldLink) { |
|||
document.head.removeChild(oldLink); |
|||
} |
|||
document.head.appendChild(link); |
|||
} |
After Width: | Height: | Size: 761 B |
After Width: | Height: | Size: 518 B |
After Width: | Height: | Size: 688 B |
After Width: | Height: | Size: 880 B |
After Width: | Height: | Size: 862 B |
After Width: | Height: | Size: 770 B |
After Width: | Height: | Size: 596 B |
After Width: | Height: | Size: 650 B |
After Width: | Height: | Size: 809 B |
After Width: | Height: | Size: 836 B |
After Width: | Height: | Size: 708 B |
After Width: | Height: | Size: 806 B |
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 877 B |
After Width: | Height: | Size: 722 B |
After Width: | Height: | Size: 718 B |
After Width: | Height: | Size: 834 B |
After Width: | Height: | Size: 741 B |
After Width: | Height: | Size: 813 B |
After Width: | Height: | Size: 817 B |
After Width: | Height: | Size: 548 B |
After Width: | Height: | Size: 549 B |
After Width: | Height: | Size: 539 B |
After Width: | Height: | Size: 647 B |
After Width: | Height: | Size: 837 B |
After Width: | Height: | Size: 607 B |
After Width: | Height: | Size: 811 B |
After Width: | Height: | Size: 885 B |
After Width: | Height: | Size: 773 B |
After Width: | Height: | Size: 786 B |
After Width: | Height: | Size: 632 B |
After Width: | Height: | Size: 801 B |
After Width: | Height: | Size: 620 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 819 B |
After Width: | Height: | Size: 680 B |
After Width: | Height: | Size: 567 B |
After Width: | Height: | Size: 841 B |
After Width: | Height: | Size: 754 B |
After Width: | Height: | Size: 778 B |
After Width: | Height: | Size: 933 B |
After Width: | Height: | Size: 764 B |
After Width: | Height: | Size: 645 B |
After Width: | Height: | Size: 582 B |
After Width: | Height: | Size: 680 B |
After Width: | Height: | Size: 796 B |
After Width: | Height: | Size: 609 B |
After Width: | Height: | Size: 659 B |
After Width: | Height: | Size: 523 B |
After Width: | Height: | Size: 489 B |
After Width: | Height: | Size: 634 B |
After Width: | Height: | Size: 569 B |
After Width: | Height: | Size: 766 B |
After Width: | Height: | Size: 734 B |
After Width: | Height: | Size: 784 B |
After Width: | Height: | Size: 768 B |
After Width: | Height: | Size: 650 B |
After Width: | Height: | Size: 534 B |
After Width: | Height: | Size: 641 B |
After Width: | Height: | Size: 625 B |
After Width: | Height: | Size: 882 B |
After Width: | Height: | Size: 771 B |
After Width: | Height: | Size: 909 B |
After Width: | Height: | Size: 670 B |
After Width: | Height: | Size: 516 B |
After Width: | Height: | Size: 519 B |
After Width: | Height: | Size: 572 B |
After Width: | Height: | Size: 789 B |
After Width: | Height: | Size: 634 B |
After Width: | Height: | Size: 830 B |
After Width: | Height: | Size: 760 B |
After Width: | Height: | Size: 654 B |
After Width: | Height: | Size: 974 B |
After Width: | Height: | Size: 730 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 761 B |
After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 561 B |
After Width: | Height: | Size: 980 B |
After Width: | Height: | Size: 754 B |
After Width: | Height: | Size: 693 B |
After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 530 B |
After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 645 B |
After Width: | Height: | Size: 702 B |
After Width: | Height: | Size: 598 B |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 707 B |
After Width: | Height: | Size: 804 B |
After Width: | Height: | Size: 694 B |
After Width: | Height: | Size: 738 B |
After Width: | Height: | Size: 744 B |
After Width: | Height: | Size: 745 B |