-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.html
58 lines (51 loc) · 1.54 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<title>Visited Places</title>
<script src="d3/d3.v3.min.js"></script>
<script src="d3/topojson.v1.min.js"></script>
<script src="datamaps/datamaps.world.min.js"></script>
</head>
<body>
<h1>Visited Places</h1>
<div id="map1" style="position: relative;"></div>
<script src="countries.js"></script>
<script src="cities.js"></script>
<script>
var map = new Datamap({
scope: 'world',
element: document.getElementById('map1'),
projection: 'mercator',
responsive: true,
height: 700,
fills: {
defaultFill: '#D0D0D0',
visited: '#B0B0B0',
city: '#FC8050'
},
geographyConfig: {
highlightOnHover: true,
highlightFillColor: '#A0C0A0',
highlightBorderColor: '#F0F0F0',
popupOnHover: true,
popupTemplate: function(geography, data) {
return '<div class="hoverinfo"><b>' + geography.properties.name + '</b></div>';
},
},
bubblesConfig: {
borderWidth: 1,
borderColor: '#FFFFFF',
highlightOnHover: true,
popupOnHover: true,
popupTemplate: function(geo, data) {
return "<div class='hoverinfo'>" + data.name + ":<br>" + data.date + "</div>";
}
},
data: COUNTRIES
});
map.bubbles(CITIES);
window.addEventListener('resize', function() {
map.resize();
});
</script>
</body>