-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
|
||
<head> | ||
|
||
<title>Hello World with MapLibreGL</title> | ||
|
||
<meta charset="utf-8" /> | ||
<link rel="shortcut icon" href="#"> | ||
<link rel="stylesheet" href="styles/style.css"> | ||
|
||
<!-- MapLibreGL's css--> | ||
<link rel="stylesheet" href="https://unpkg.com/maplibre-gl/dist/maplibre-gl.css" /> | ||
|
||
<!-- MapLibreGL's JavaScript--> | ||
<script src="https://unpkg.com/maplibre-gl/dist/maplibre-gl.js"></script> | ||
</head> | ||
|
||
<body> | ||
|
||
<header> | ||
<h1>TITLE</h1> | ||
</header> | ||
|
||
<main> | ||
|
||
<!-- hint: majority of your lab assignment can go here --> | ||
<div class="portfolio"> | ||
<h3>profile</h3> | ||
<!-- Portfolio content goes here --> | ||
<img src="images/avatar.jpg" alt="A photo of the site creator"> | ||
<p></p> | ||
</div> | ||
|
||
<h3>maps</h3> | ||
<div id="map"> | ||
|
||
<!-- Map will be inserted here --> | ||
</div> | ||
|
||
</main> | ||
|
||
<div id="footer"> | ||
Copyright(2024) | ||
</div> | ||
|
||
<script src="js/init.js"></script> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Initialize the map | ||
const map = new maplibregl.Map({ | ||
container: 'map', // container ID | ||
style: 'https://api.maptiler.com/maps/streets/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL', // Your style URL | ||
center: [-118.444, 34.0709], // Starting position [lng, lat] | ||
zoom: 15 // Starting zoom level | ||
}); | ||
|
||
// Add a marker to the map | ||
new maplibregl.Marker() | ||
.setLngLat([34.0709, -118.444]) | ||
.setPopup(new maplibregl.Popup({ offset: 25 }) // Add popups | ||
.setHTML('Math Sciences 4328 aka the Technology Sandbox<br> is the lab where I used to work in ')) | ||
.addTo(map); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* The * selects everything and acts as a global reset to ensure consistency across browsers */ | ||
* { | ||
font-family: 'Courier New', monospace; | ||
margin: 0; | ||
padding: 0; | ||
box-sizing: border-box; | ||
} | ||
|
||
/* Sets the overall background and ensures the content fits the screen height */ | ||
html { | ||
background-color: #ffcbcd; | ||
} | ||
|
||
html, | ||
body { | ||
height: 80vh; | ||
padding: 1rem; | ||
} | ||
|
||
/* Defines the page layout using a grid */ | ||
body { | ||
display: grid; | ||
grid-template-areas: | ||
"header" | ||
"main" | ||
"footer"; | ||
grid-template-rows: auto 1fr auto; | ||
/* Adjusted to reflect the simplified structure */ | ||
} | ||
|
||
main { | ||
display: grid; | ||
grid-template-areas: "portfolio map"; | ||
grid-template-columns: 1fr 1fr; | ||
} | ||
|
||
/* Assigns each major section to a part of the grid */ | ||
header { | ||
grid-area: header; | ||
} | ||
|
||
main { | ||
grid-area: main; | ||
} | ||
|
||
.portfolio { | ||
grid-area: portfolio; | ||
} | ||
|
||
img { | ||
width: 300px; | ||
height: auto; | ||
} | ||
|
||
#map { | ||
grid-area: map; | ||
height: 80vh; | ||
} | ||
|
||
footer { | ||
grid-area: footer; | ||
} |