Compare commits

...

2 commits

Author SHA1 Message Date
Robbe Van Herck
f11053024b
Add links to Kortrijk and Gent 2019-12-13 15:42:29 +01:00
Robbe Van Herck
b5db3d5860
Update README.md 2019-12-13 15:11:02 +01:00
3 changed files with 17 additions and 2 deletions

View file

@ -2,7 +2,7 @@
A useful map that lists all the public study locations in Ghent. A useful map that lists all the public study locations in Ghent.
We usually use data from [Stad Gent](https://stad.gent/studenten/studeren/bloklocaties) and emails sent by people.. We usually use data from [Stad Gent](https://stad.gent/studenten/studeren/bloklocaties), [Stad Kortrijk](http://www.kortrijkstudentenstad.be/aanbod/bloklocaties/) and emails sent by people..
## Development ## Development

View file

@ -98,6 +98,12 @@
<a href="http://schamper.be/"><img id="schamper" src="img/schamper.png"></a> <a href="http://schamper.be/"><img id="schamper" src="img/schamper.png"></a>
<a href="http://zeus.ugent.be/"><img id="zeus" src="img/zeus.png"></a> <a href="http://zeus.ugent.be/"><img id="zeus" src="img/zeus.png"></a>
</script> </script>
<script id="city-select-template" type="text/x-handlebars-template">
<ul>
<li><a onclick="moveToCoords(51.0475378, 3.7261835, 13)">Gent</a></li>
<li><a onclick="moveToCoords(50.8276123, 3.2672309, 15)">Kortrijk</a></li>
</ul>
</script>
<script id="share-template" type="text/x-handlebars-template"> <script id="share-template" type="text/x-handlebars-template">
<div class="fb-share-button" data-href="//blok.ugent.be" data-layout="button_count"></div> <div class="fb-share-button" data-href="//blok.ugent.be" data-layout="button_count"></div>
</script> </script>

View file

@ -1,3 +1,4 @@
var map;
$(document).ready(function() { $(document).ready(function() {
/* change image path */ /* change image path */
L.Icon.Default.imagePath = 'img'; L.Icon.Default.imagePath = 'img';
@ -40,7 +41,7 @@ $(document).ready(function() {
return marker return marker
} }
var map = L.map('map').setView([51.0475378, 3.7261835], 13); 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}{r}.png', { var osm = L.tileLayer('https://{s}.tiles.mapbox.com/v3/feliciaan.keoaj8d5/{z}/{x}/{y}{r}.png', {
attribution: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> | © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-contributors | Made with ❤ by <a href="https://zeus.ugent.be">Zeus WPI</a>', attribution: '© <a href="https://www.mapbox.com/map-feedback/">Mapbox</a> | © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-contributors | Made with ❤ by <a href="https://zeus.ugent.be">Zeus WPI</a>',
detectRetina: true detectRetina: true
@ -163,6 +164,10 @@ $(document).ready(function() {
position: 'topright' position: 'topright'
}).addTo(map); }).addTo(map);
var citySelect = new SimpleControl('#city-select-template', christmasHoliday ? "holiday-legend" : "legend", {
position: 'topleft'
}).addTo(map);
var sharePane = new SimpleControl('#share-template', 'info', { var sharePane = new SimpleControl('#share-template', 'info', {
position: 'bottomleft' position: 'bottomleft'
}).addTo(map); }).addTo(map);
@ -171,3 +176,7 @@ $(document).ready(function() {
position: 'bottomright' position: 'bottomright'
}).addTo(map); }).addTo(map);
}); });
function moveToCoords(x, y, scale) {
map.setView([x, y], scale);
}