-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
20 lines (17 loc) · 688 Bytes
/
app.js
File metadata and controls
20 lines (17 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const map = L.map('map').setView([-25.7479, 28.2293], 13); // Example: Pretoria, South Africa
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© OpenStreetMap contributors'
}).addTo(map);
// Add markers
const locations = [
{ lat: -25.7479, lng: 28.2293, name: "Pretoria" },
{ lat: -26.2041, lng: 28.0473, name: "Johannesburg" },
{ lat: -29.8587, lng: 31.0218, name: "Durban" },
{ lat: -33.9249, lng: 18.4241, name: "Cape Town" },
{ lat: -34.0364, lng: 23.0473, name: "Knysna" }
];
locations.forEach(location => {
L.marker([location.lat, location.lng])
.addTo(map)
.bindPopup(`<b>${location.name}</b>`);
});