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

Added map to leaflet/index.html #6

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
12 changes: 0 additions & 12 deletions index.html

This file was deleted.

95 changes: 95 additions & 0 deletions leaflet.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Navbar and Leaflet Map</title>
<!-- Style CSS -->
<link rel="stylesheet" href="style.css">
<!-- Leaflet CSS -->
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
<style>
body {
margin: 0;
padding: 0;
}
nav {
position: fixed;
top: 0;
width: 100%;
background-color: #333;
z-index: 1000;
}
nav ul {
list-style-type: none;
padding: 0;
margin: 0;
display: flex;
}
nav ul li {
margin: 0;
padding: 0;
}
nav ul li a {
display: block;
padding: 14px 20px;
text-decoration: none;
color: white;
}
nav ul li a:hover {
background-color: #111;
}
.map-container {
display: flex;
justify-content: center;
width: 100%;
margin-top: 50px; /* Adjust this value to match the height of the navbar */
}
#map {
height: 500px;
width: 50%;
top: 50px;
}
</style>
</head>
<body>

<!-- Navbar -->
<body>
<div>
<nav>
<ul>
<li><a href="navigation.html">Navigation</a></li>
<li><a href="events.html">Events</a></li>
<li><a href="updates.html">Updates</a></li>
<li><a href="sos.html">SOS</a></li>
</ul>
</nav>
</div>
</body>

<!-- Map Container -->
<div class="map-container">
<div id="map"></div>
</div>

<!-- Leaflet JS -->
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
<script>
// Initialize the map
var map = L.map('map').setView([33.6461, -117.8427], 17);

// Add a tile layer to the map
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
}).addTo(map);

// Marker
var LangsonLibrary = L.marker([33.64726022568338, -117.84109973490287]).addTo(map);
var popup = LangsonLibrary.bindPopup('Langson Library').openPopup()


</script>

</body>
</html>
Empty file removed style.css
Empty file.