96 lines
3.5 KiB
HTML
96 lines
3.5 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>
|
|
<img src="{{type}}.png" class="type">
|
|
Waar: {{address}}<br />
|
|
Plaatsen: {{capacity}}<br />
|
|
Van {{period.start}} tot {{period.end}}<br />
|
|
<table>
|
|
<tr>
|
|
<td>Maandag</td>
|
|
<td>Dinsdag</td>
|
|
<td>Woensdag</td>
|
|
<td>Donderdag</td>
|
|
<td>Vrijdag</td>
|
|
<td>Zaterdag</td>
|
|
<td>Zondag</td>
|
|
</tr>
|
|
<tr>
|
|
<td>{{#if hours.monday}}{{hours.monday}}{{else}}Gesloten{{/if}}</td>
|
|
<td>{{#if hours.tuesday}}{{hours.tuesday}}{{else}}Gesloten{{/if}}</td>
|
|
<td>{{#if hours.wednesday}}{{hours.wednesday}}{{else}}Gesloten{{/if}}</td>
|
|
<td>{{#if hours.thursday}}{{hours.thursday}}{{else}}Gesloten{{/if}}</td>
|
|
<td>{{#if hours.friday}}{{hours.friday}}{{else}}Gesloten{{/if}}</td>
|
|
<td>{{#if hours.saturday}}{{hours.saturday}}{{else}}Gesloten{{/if}}</td>
|
|
<td>{{#if hours.sunday}}{{hours.sunday}}{{else}}Gesloten{{/if}}</td>
|
|
</tr>
|
|
</table>
|
|
|
|
{{#if extra}}{{extra}}{{/if}}
|
|
</div>
|
|
</script>
|
|
<script id="info-template" type="text/x-handlebars-template">
|
|
<a href="http://zeus.ugent.be/"><img src='logo.png'></a>
|
|
</script>
|
|
<script type="text/javascript">
|
|
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('https://{s}.tiles.mapbox.com/v3/feliciaan.keoaj8d5/{z}/{x}/{y}.png', {
|
|
attribution: 'Made by <a href="http://zeus.ugent.be">Zeus WPI</a> with ❤ and <a href="http://www.mapbox.com/about/maps/" target="_blank">Mapbox</a>'
|
|
}).addTo(map);
|
|
|
|
$.getJSON('data.json')
|
|
.done(function(data) {
|
|
var geojson = L.geoJson(data, {
|
|
onEachFeature: onEachFeature
|
|
});
|
|
map.addLayer(geojson);
|
|
});
|
|
|
|
var info = L.control();
|
|
|
|
info.onAdd = function (map) {
|
|
var div = L.DomUtil.create('div', 'info');
|
|
div.innerHTML = Handlebars.compile($('#info-template').html())();
|
|
|
|
return div;
|
|
};
|
|
|
|
info.addTo(map);
|
|
});
|
|
</script>
|
|
<script>
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
|
|
ga('create', 'UA-25444917-8', 'auto');
|
|
ga('send', 'pageview');
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|