diff --git a/INFO-3163 (CMS Web Dev)/Labs/lab 2/SDLCTemplate.docx b/INFO-3163 (CMS Web Dev)/Labs/lab 2/SDLCTemplate.docx index 17228f3..7dbc3c1 100644 Binary files a/INFO-3163 (CMS Web Dev)/Labs/lab 2/SDLCTemplate.docx and b/INFO-3163 (CMS Web Dev)/Labs/lab 2/SDLCTemplate.docx differ diff --git a/INFO-3168 (JS 2)/Notes/code1/code1/index.html b/INFO-3168 (JS 2)/Notes/code1/index.html similarity index 100% rename from INFO-3168 (JS 2)/Notes/code1/code1/index.html rename to INFO-3168 (JS 2)/Notes/code1/index.html diff --git a/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/dataHandler.js b/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/dataHandler.js index 23b8300..6da8d80 100644 --- a/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/dataHandler.js +++ b/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/dataHandler.js @@ -1,22 +1,4 @@ -fetch('./js/Meteorite_Landings.json') - .then((response) => response.json()) - .then(data => { - console.log(data); - const tableBody = document.getElementById("meteorTableBody"); - data.splice(0,50).forEach(meteor => { // Just get 50 values for now - const row = document.createElement("tr"); - const id = document.createElement("td"); - id.textContent = meteor.id ?? "-"; - const name = document.createElement("td"); - name.textContent = meteor.name ?? "-"; - const year = document.createElement("td"); - year.textContent = meteor.year ?? "-"; - const recclass = document.createElement("td"); - recclass.textContent = meteor.recclass ?? "-"; - const mass = document.createElement("td"); - mass.textContent = meteor["mass (g)"] + "g" ?? "-"; - row.append(id, name, year, recclass, mass); - tableBody.appendChild(row); - }) - }) - .catch(error => console.error(error)); \ No newline at end of file +// TODO: +// Implement Search by year and name +// Reset filters button +// Clickable table headers for sortin (reuse code?) \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/main.js b/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/main.js index e69de29..c670a3d 100644 --- a/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/main.js +++ b/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/main.js @@ -0,0 +1,22 @@ +fetch('./js/Meteorite_Landings.json') + .then((response) => response.json()) + .then(data => { + console.log(data); + const tableBody = document.getElementById("meteorTableBody"); + data.splice(0,500).forEach(meteor => { // Just get 500 values for now + const row = document.createElement("tr"); + const id = document.createElement("td"); + id.textContent = meteor.id ?? "-"; + const name = document.createElement("td"); + name.textContent = meteor.name ?? "-"; + const year = document.createElement("td"); + year.textContent = meteor.year ?? "-"; + const recclass = document.createElement("td"); + recclass.textContent = meteor.recclass ?? "-"; + const mass = document.createElement("td"); + mass.textContent = meteor["mass (g)"] + "g" ?? "-"; + row.append(id, name, year, recclass, mass); + tableBody.appendChild(row); + }) + }) + .catch(error => console.error(error)); \ No newline at end of file diff --git a/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/map.js b/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/map.js index ca922b9..7079405 100644 --- a/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/map.js +++ b/INFO-3168 (JS 2)/Project/LeviMclean_nasa-meteorite-explorer/js/map.js @@ -4,6 +4,36 @@ function loadMap() { center: {lat: 0, lng: 0}, // Center of the globe zoom: 2 }); -} -// Add custom markers from meteor data \ No newline at end of file + const infoWindow = new google.maps.InfoWindow(); // create InfoWindow object to use later + + // Add custom markers from meteor data + fetch("./js/Meteorite_Landings.json") + .then((response) => response.json()) + .then(data => { + data.splice(0,500).forEach(location => { + const marker = new google.maps.Marker({ + position: { lat: location.reclat, lng: location.reclong}, + map: map, + title: location.name + }); + + marker.addListener("click", () => { // Open and show the InfoWindow on click + const content = ` +
Mass: ${location["mass (g)"]} g
+Year: ${location.year}
+Class: ${location.recclass}
+Fall Status: ${location.fall}
+Recorded Latitude: ${location.reclat}
+Recorded Longitude: ${location.reclong}
+