-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathmap_ios_enq_wallet_transparent.html
54 lines (53 loc) · 1.92 KB
/
map_ios_enq_wallet_transparent.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
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link href="assets/css/vendor/jquery-jvectormap-1.2.2.css" rel="stylesheet" type="text/css" />
<link href="assets/css/app-dark.min.css" rel="stylesheet" type="text/css" />
<!-- angularJS scripts -->
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body style="background: transparent; height: 100vh; padding: 0px;">
<div id="world-map-markers" style="height: 100%; background: transparent;"></div>
<!-- scripts for widgets -->
<script src="assets/js/vendor/jquery-jvectormap-1.2.2.min.js" ></script>
<script src="assets/js/vendor/jquery-jvectormap-world-mill-en.js" ></script>
<script type="text/javascript">
$(document).ready(function () {
var settings = {
"async": true,
"crossDomain": true,
"url": "/api/v1/peer_map",
"method": "GET"
};
$.ajax(settings).done(function(response) {
let nodesCount = 0;
let marker_style = [{r: 5, fill:'blue'}, {r: 5, fill:'blue'}, {r: 5, fill:'red'}];
let markers = response.filter((el)=> (el.lat !== null && el.lon !== null))
.map((el) => {
nodesCount+=el.count;
return {latLng:[el.lat, el.lon], name:el.count.toString(), style: marker_style[el.type] }
});
$(function(){
$("#nodeCount").text(nodesCount);
$("#world-map-markers").vectorMap({
map:"world_mill_en", normalizeFunction:"polynomial", hoverOpacity:.7, hoverColor:!1,zoomButtons : false, regionStyle: {
initial: { fill: "rgba(205,218,224,0.16)" }
},
markerStyle: {
initial: {
r: 9, fill: "#727cf5", "fill-opacity": .9, stroke: "#fff", "stroke-width": 7, "stroke-opacity": .4
},
hover: {
stroke: "#fff", "fill-opacity": 1, "stroke-width": 1.5
}
},
backgroundColor:"transparent",
markers: markers
});
});
});
});
</script>
</body>
</html>