forked from apu52/Travel_Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapa.html
42 lines (37 loc) · 1.54 KB
/
mapa.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
41
42
<!DOCTYPE html>
<html>
<head>
<title>Tourism Map</title>
<!-- Include Leaflet.js CSS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<style>
/* Set the height and width for the map container */
#map {
height: 100vh; /* Full viewport height */
width: 100%; /* Full width */
}
</style>
</head>
<body>
<div id="map"></div>
<!-- Include Leaflet.js JavaScript -->
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script>
// Initialize the map and set its view to a chosen location and zoom level
const map = L.map('map').setView([20.5937, 78.9629], 5); // Coordinates for India (latitude, longitude)
// Add a tile layer to the map (OpenStreetMap tiles)
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '© OpenStreetMap contributors',
}).addTo(map);
// Add a marker for a tourism site (e.g., Taj Mahal)
const marker = L.marker([27.1751, 78.0421]).addTo(map);
marker.bindPopup('<b>Taj Mahal</b><br>A UNESCO World Heritage Site.').openPopup();
// Add more markers as needed for other sites
const qutubMinar = L.marker([28.5245, 77.1855]).addTo(map);
qutubMinar.bindPopup('<b>Qutub Minar</b><br>A historical monument in Delhi.');
const gatewayOfIndia = L.marker([18.922, 72.8347]).addTo(map);
gatewayOfIndia.bindPopup('<b>Gateway of India</b><br>Iconic tourist attraction in Mumbai.');
</script>
</body>
</html>