Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: View button lead to blank page #1644

Merged
merged 1 commit into from
Nov 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 35 additions & 13 deletions mapa.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>

<link rel="stylesheet" type="text/css" href="maps.css" />
<script async
src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&loading=async&callback=initMap"

defer>
</script>
<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>

<!-- prettier-ignore -->

</body>
<script type="module" src="maps.js"></script>
<!-- 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);

</html>
// 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>
Loading