-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
43 lines (40 loc) · 1.07 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<html>
<head>
<title>TorMap - Jordan Wright (jmwright798 at gmail.com)</title>
<script src="js/jquery.min.js"></script>
<script src="js/jquery-jvectormap-1.2.2.min.js"></script>
<script src="js/jquery-jvectormap-world-mill-en.js"></script>
<link rel="stylesheet" media="all" href="css/jquery-jvectormap-1.2.2.css"/>
</head>
<body>
<div style="height:100%;width:100%" id="tor_map"></div>
<script>
$(function(){
$('#tor_map').vectorMap({
map: 'world_mill_en',
scaleColors: ['#C8EEFF', '#0071A4'],
normalizeFunction: 'polynomial',
hoverOpacity: 0.7,
hoverColor: false,
markerStyle: {
initial: {
fill: '#cc6600',
stroke: '#222222',
r: 2
}
},
backgroundColor: '#222222',
markers: [
]
});
map = $('#tor_map').vectorMap('get', 'mapObject');
$.getJSON('https://onionoo.torproject.org/details', function(data){
$.each(data.relays, function(idx, relay)
{
map.addMarker(relay.or_addresses[0], {'latLng' : [relay.latitude, relay.longitude], "name" : relay.or_addresses[0]});
});
});
});
</script>
</body>
</html>