-
Notifications
You must be signed in to change notification settings - Fork 0
/
newtab.html
40 lines (34 loc) · 1.1 KB
/
newtab.html
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
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OpenStreetMap with Markers</title>
<link rel="stylesheet" href="leaflet/leaflet.css">
</head>
<body>
<div id="map" style="height:400px;"></div>
<script src="leaflet/leaflet-src.js"></script>
<script>
xyz= document.createElement('div');
document.body.appendChild(xyz);
xyz.style.height="800px";
// Initialize the map
var map = L.map('map').setView([51.505, -0.09], 13);
// Add OpenStreetMap tile layer
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// List of markers with coordinates
var markers = [
{ lat: 51.5, lng: -0.09, title: 'Marker 1' },
{ lat: 51.51, lng: -0.1, title: 'Marker 2' },
// Add more markers as needed
];
// Add markers to the map
markers.forEach(function(marker) {
L.marker([marker.lat, marker.lng]).addTo(map).bindPopup(marker.title);
});
</script>
</body>
</html>