-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
51 lines (45 loc) · 1.23 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>map breaker</title>
<style>
* {
box-sizing: border-box;
}
body {
position: absolute;
width: 100%;
height: 100%;
margin: 0;
display: flex;
}
#map {
width: 768px;
height: 768px;
margin: auto;
}
</style>
<script src="dist/map-breaker.js"></script>
</head>
<body>
<div id="map"></div>
<script>
var search = window.location && window.location.search && window.location.search.split('?') || [];
var projection = search[1] || ''
fetch('countries.geo.json')
.then(function (res) {
res.json()
.then(function (featureCollection) {
const mapBreaker = new MapBreaker('#map', {
propertyKey: 'name',
leftKeyCode: 65,
rightKeyCode: 68
});
mapBreaker.wall(featureCollection, projection);
mapBreaker.loop();
});
});
</script>
</body>
</html>