blokmap/map.html
2014-12-09 19:54:50 +01:00

84 lines
2.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Blokken in Gent</title>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<link rel="stylesheet" href="map.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="http://maps.google.com/maps/api/js?v=3.2&sensor=false"></script>
<script src="http://matchingnotes.com/javascripts/leaflet-google.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script>
</head>
<body>
<div id="map"></div>
<script id="popup-template" type="text/x-handlebars-template">
<div id="resto-popup">
<h3>{{name}}</h3>
<ul>
<li><b>Adres:</b> {{address}}</li>
<li><b>Capaciteit:</b> {{capacity}}</li>
<li><b>Periode:</b> Van {{period.start}} tot {{period.end}}</li>
</ul>
Openingsuren
<ul>
<li><b>Maandag:</b> {{hours.monday}}</li>
<li><b>Dinsdag:</b> {{hours.tuesday}}</li>
<li><b>Woensdag:</b> {{hours.wednesday}}</li>
<li><b>Donderdag:</b> {{hours.thursday}}</li>
<li><b>Vrijdag:</b> {{hours.friday}}</li>
<li><b>Zaterdag:</b> {{hours.saturday}}</li>
<li><b>Zondag:</b> {{hours.sunday}}</li>
</ul>
Extra: {{extra}}
</div>
</script>
<script type="text/javascript">
var data = [{
'type': "Feature",
'geometry': {
'type': "Point",
'coordinates': [3.726759, 51.045660]
},
'properties': {
'name': "Studentenrestaurant De Brug",
'address': "Sint-Pietersnieuwstraat 45",
'capacity': 700,
'period': { 'start': "18/08/2014", 'end': "12/09/2014" },
'hours': {
'monday': "8u - 22u",
'tuesday': "8u - 22u",
'wednesday': "8u - 22u",
'thursday': "8u - 22u",
'friday': "8u - 22u",
'saturday': false,
'sunday': false
},
'extra': '2 aparte zaaltjes doorlopend beschikbaar (120 plaatsen).'
}
}];
var popuptemplate = Handlebars.compile($('#popup-template').html());
function onEachFeature(feature, layer) {
if (feature.properties) {
layer.bindPopup(popuptemplate(feature.properties));
}
}
$(document).ready(function() {
var map = L.map('map').setView([51.0475378, 3.7261835], 13);
var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: 'Made by <a href="http://zeus.ugent.be">Zeus</a> with ❤!'
}).addTo(map);
var geojson = L.geoJson(data, {
onEachFeature: onEachFeature
});
map.addLayer(geojson);
});
</script>
</body>
</html>