-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
74 lines (71 loc) · 2.24 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="A useless map library" />
<title>Useless Map</title>
<link rel="stylesheet" href="useless-map.css">
<script src="useless-map.js"></script>
<script src="useless-tools/eyes.js"></script>
<script src="useless-tools/mirror.js"></script>
<script src="useless-tools/magnet.js"></script>
<script src="useless-tools/gravity.js"></script>
<script src="useless-tools/blur.js"></script>
<style>
body,
html {
position: absolute;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
}
#container {
width: 80%;
height: 80%;
background-color: #f2f2f2;
}
</style>
</head>
<body>
<div id="container"></div>
<script>
fetch('data/countries.geo.json')
.then(res => res.json())
.then((data) => {
const map = UselessMap.setup({
target: '#container',
background: {
colors: ['#39cae3', '#f0d577', '#ec6308'],
direction: 'vertical'
},
zoom: 2,
center: [0, 0],
debug: false,
style: [{
layer: 'countries',
fill: '#f2f2f2',
stroke: '#444444',
strokeWidth: 0.5
}],
layers: [
{
type: 'geojson',
id: 'countries',
data: data
}
]
});
map.addTool(UselessMap.eyes());
map.addTool(UselessMap.mirror());
map.addTool(UselessMap.magnet());
map.addTool(UselessMap.gravity());
map.addTool(UselessMap.blur());
});
</script>
</body>
</html>