-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
33 lines (26 loc) · 1.73 KB
/
app.js
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
var map;
function loadMap() {
L.mapbox.accessToken = 'pk.eyJ1IjoiZGViYWtlbCIsImEiOiJjaWthZGR6MGYwMDI3d2xsdmFveno2dzVqIn0._2PQT_7CyCFzi3Gfs5a_Zw';
map = L.mapbox.map('map', 'mapbox.dark')
.setView([50.952,9.371], 7);
map.addControl(L.mapbox.infoControl());
map.removeControl(this.map.attributionControl);
//L.control.locate().addTo(map);
//var sidebar = L.control.sidebar('sidebar').addTo(map);
}
function loadGeoJSON() {
var featureLayer = L.mapbox.featureLayer();
featureLayer.on('layeradd', function (e) {
var marker = e.layer,
feature = marker.feature;
marker.setIcon(L.divIcon(feature.properties.icon));
});
featureLayer.loadURL('data/events.geojson', onEachLayer = function () {
});
map.addLayer(featureLayer);
}
function init() {
loadMap();
loadGeoJSON();
}
window.onload = init();