-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
95 lines (78 loc) · 2.71 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>map of c-base</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="static/bootstrap/bootstrap-3.1.1-dist/css/bootstrap.min.css" type="text/css">
<link href="static/leaflet-0.7.2/leaflet.css" rel="stylesheet">
<style>
body {
padding: 0;
margin: 0;
}
html, body, #map {
height: 100%;
width: 100%;
}
#map {
background-color: #000;
}
</style>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="map"></div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="static/jquery-2.1.0.min.js" type="text/javascript" charset="utf-8"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="static/bootstrap/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
<script src="static/handlebars-v1.3.0.js" type="text/javascript"></script>
<script src="static/leaflet-0.7.2/leaflet.js"></script>
<script src="icons.js"></script>
<script src="markers.js"></script>
<!-- this describes how map marker popups are gonna look like -->
<script type="text/x-handlebars-template" id="popup-template">
<b>{{ name }}</b><br />
{{ desc }}<br />
<br />
<a href="{{ url }}">Go on my dear ...</a>
</script>
<script type="text/javascript">
var app = app || {};
$(document).ready(function() {
var map = L.map('map', {
minZoom: 2,
maxZoom: 4,
zoom: 2,
center: [0,0],
maxBounds: [[-80,-180],[80,180]]
});
L.tileLayer('map-tiles/{z}/{x}/{y}.jpg', {
attribution: 'Icons: <a href="http://mapicons.nicolasmollet.com/">Nicolas Mollet</a> | <a href="http://c-base.org/">c-base e.V.</a>!',
noWrap: true
}).addTo(map);
var source = $("#popup-template").html();
var template = Handlebars.compile(source);
$.each(app.markers, function() {
var icon;
if(this.icon !== undefined) {
icon = this.icon
} else {
icon = app.blue_icon;
}
var marker = L.marker(this.coord, {icon: icon}).addTo(map);
var html = template(this);
marker.bindPopup(html);
});
});
</script>
</body>
</html>