-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
32 lines (29 loc) · 732 Bytes
/
Copy pathscript.js
File metadata and controls
32 lines (29 loc) · 732 Bytes
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
// Initialize map at Alma College coordinates
var map = L.map('map').setView([43.3785, -84.6695], 16);
// Add map tiles
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19
}).addTo(map);
// Add markers
var places = [
{
name: "Library",
coords: [43.3785, -84.6695],
desc: "Main library with study spaces."
},
{
name: "Dining Hall",
coords: [43.3780, -84.6702],
desc: "Open 7 AM – 8 PM daily."
},
{
name: "Stone Recreation Center",
coords: [43.3792, -84.6685],
desc: "Gym, pool, and sports facilities."
}
];
// Loop through places and add them
places.forEach(p => {
L.marker(p.coords).addTo(map)
.bindPopup(`<b>${p.name}</b><br>${p.desc}`);
});