forked from elan-ev/bigbluebutton-map
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leafletmap.js
26 lines (21 loc) · 694 Bytes
/
leafletmap.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
window.onload = function () {
console.log("Script is running")
var basemap = L.tileLayer('https://a.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://osm.org/copyright">OpenStreetMap</a> contributors',
noWrap: false
});
$.getJSON("adopters.geojson", function(data) {
function onEachFeature(feature, layer) {
layer.bindPopup("Institution: " + feature.properties.institution);
}
var geojson = L.geoJson(data, {
onEachFeature: onEachFeature
});
var map = L.map('my-map',{
minZoom: 2
})
.fitBounds(geojson.getBounds());
basemap.addTo(map);
geojson.addTo(map);
});
};