-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.html
40 lines (40 loc) · 1.3 KB
/
map.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
<!DOCTYPE html>
<html>
<head>
<title>hosting safety world map</title>
<link rel="stylesheet" href="jquery-jvectormap-1.2.2.css" type="text/css" media="screen"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="jquery-jvectormap-1.2.2.min.js"></script>
<script src="jquery-jvectormap-world-mill-en.js"></script>
<script src="data.js"></script>
</head>
<body>
<div id="world-map" style="width: 900px; height: 700px"></div>
<script>
$('#world-map').vectorMap({
map: 'world_mill_en',
series: {
regions: [{
values: safetyData,
scale: ['#FF0000', '#00FF00'],
normalizeFunction: 'linear'
}]
},
onRegionLabelShow: function(e, el, code){
if (safetyData[code] == 0) {
el.html(el.html()+' - '+code+'<hr><strong>Unsafe for hosting</strong><br>'+infoData[code]);
} else if (safetyData[code] == 1) {
el.html(el.html()+' - '+code+'<hr><strong>Rumored to be unsafe for hosting</strong><br>'+infoData[code]);
} else if (safetyData[code] == 2) {
el.html(el.html()+' - '+code+'<hr><strong>Possibly safe for hosting</strong><br>'+infoData[code]);
} else {
el.html(el.html()+' - '+code+'<hr>Unknown');
}
},
onRegionClick: function(el, code){
alert(infoData[code]);
}
});
</script>
</body>
</html>