From 24c9ac09a1c62a74de2f80efb63503b2031a9d25 Mon Sep 17 00:00:00 2001 From: pranjals149 <42092291+pranjals149@users.noreply.github.com> Date: Thu, 16 Jan 2020 17:12:14 +0530 Subject: [PATCH] Added EONET API --- .gitignore => APOD/.gitignore | 0 README.md => APOD/README.md | 0 package-lock.json => APOD/package-lock.json | 0 package.json => APOD/package.json | 0 {public => APOD/public}/favicon.ico | Bin {public => APOD/public}/index.html | 0 {public => APOD/public}/logo192.png | Bin {public => APOD/public}/logo512.png | Bin {public => APOD/public}/manifest.json | 0 {public => APOD/public}/robots.txt | 0 {src => APOD/src}/App.css | 0 {src => APOD/src}/App.js | 0 {src => APOD/src}/App.test.js | 0 {src => APOD/src}/components/DateInput.js | 0 {src => APOD/src}/components/Photo.js | 0 {src => APOD/src}/index.css | 0 {src => APOD/src}/index.js | 0 {src => APOD/src}/logo.svg | 0 {src => APOD/src}/serviceWorker.js | 0 {src => APOD/src}/setupTests.js | 0 EONET/app.js | 121 ++++++++++++++++++++ EONET/index.html | 36 ++++++ EONET/style.css | 24 ++++ 23 files changed, 181 insertions(+) rename .gitignore => APOD/.gitignore (100%) rename README.md => APOD/README.md (100%) rename package-lock.json => APOD/package-lock.json (100%) rename package.json => APOD/package.json (100%) rename {public => APOD/public}/favicon.ico (100%) rename {public => APOD/public}/index.html (100%) rename {public => APOD/public}/logo192.png (100%) rename {public => APOD/public}/logo512.png (100%) rename {public => APOD/public}/manifest.json (100%) rename {public => APOD/public}/robots.txt (100%) rename {src => APOD/src}/App.css (100%) rename {src => APOD/src}/App.js (100%) rename {src => APOD/src}/App.test.js (100%) rename {src => APOD/src}/components/DateInput.js (100%) rename {src => APOD/src}/components/Photo.js (100%) rename {src => APOD/src}/index.css (100%) rename {src => APOD/src}/index.js (100%) rename {src => APOD/src}/logo.svg (100%) rename {src => APOD/src}/serviceWorker.js (100%) rename {src => APOD/src}/setupTests.js (100%) create mode 100644 EONET/app.js create mode 100644 EONET/index.html create mode 100644 EONET/style.css diff --git a/.gitignore b/APOD/.gitignore similarity index 100% rename from .gitignore rename to APOD/.gitignore diff --git a/README.md b/APOD/README.md similarity index 100% rename from README.md rename to APOD/README.md diff --git a/package-lock.json b/APOD/package-lock.json similarity index 100% rename from package-lock.json rename to APOD/package-lock.json diff --git a/package.json b/APOD/package.json similarity index 100% rename from package.json rename to APOD/package.json diff --git a/public/favicon.ico b/APOD/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to APOD/public/favicon.ico diff --git a/public/index.html b/APOD/public/index.html similarity index 100% rename from public/index.html rename to APOD/public/index.html diff --git a/public/logo192.png b/APOD/public/logo192.png similarity index 100% rename from public/logo192.png rename to APOD/public/logo192.png diff --git a/public/logo512.png b/APOD/public/logo512.png similarity index 100% rename from public/logo512.png rename to APOD/public/logo512.png diff --git a/public/manifest.json b/APOD/public/manifest.json similarity index 100% rename from public/manifest.json rename to APOD/public/manifest.json diff --git a/public/robots.txt b/APOD/public/robots.txt similarity index 100% rename from public/robots.txt rename to APOD/public/robots.txt diff --git a/src/App.css b/APOD/src/App.css similarity index 100% rename from src/App.css rename to APOD/src/App.css diff --git a/src/App.js b/APOD/src/App.js similarity index 100% rename from src/App.js rename to APOD/src/App.js diff --git a/src/App.test.js b/APOD/src/App.test.js similarity index 100% rename from src/App.test.js rename to APOD/src/App.test.js diff --git a/src/components/DateInput.js b/APOD/src/components/DateInput.js similarity index 100% rename from src/components/DateInput.js rename to APOD/src/components/DateInput.js diff --git a/src/components/Photo.js b/APOD/src/components/Photo.js similarity index 100% rename from src/components/Photo.js rename to APOD/src/components/Photo.js diff --git a/src/index.css b/APOD/src/index.css similarity index 100% rename from src/index.css rename to APOD/src/index.css diff --git a/src/index.js b/APOD/src/index.js similarity index 100% rename from src/index.js rename to APOD/src/index.js diff --git a/src/logo.svg b/APOD/src/logo.svg similarity index 100% rename from src/logo.svg rename to APOD/src/logo.svg diff --git a/src/serviceWorker.js b/APOD/src/serviceWorker.js similarity index 100% rename from src/serviceWorker.js rename to APOD/src/serviceWorker.js diff --git a/src/setupTests.js b/APOD/src/setupTests.js similarity index 100% rename from src/setupTests.js rename to APOD/src/setupTests.js diff --git a/EONET/app.js b/EONET/app.js new file mode 100644 index 0000000..82c3036 --- /dev/null +++ b/EONET/app.js @@ -0,0 +1,121 @@ +$(document).ready(function () { + + var setMap = L.map('mapping').setView([0, 0], 2) + + L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: '© <© OpenStreetMap', + maxZoom: 19 + }).addTo(setMap) + + var totalColors = [] + + var markedColor + + $.ajax({ + type: 'GET', + url: 'https://eonet.sci.gsfc.nasa.gov/api/v2.1/categories?api_key=e0xaFTehVbUGmZjo2H94BthXsxaR8YYemqp9imxM', + dataType: 'json' + }).done(function (fetchedData) { + fetchedData.categories.forEach(function (data) { + switch (data.id) { + case 6: + totalColors.push({id: data.id, title: data.title, color: '#348899'}) + break + case 7: + totalColors.push({id: data.id, title: data.title, color: '#962D3E'}) + break + case 16: + totalColors.push({id: data.id, title: data.title, color: '#261722'}) + break + case 9: + totalColors.push({id: data.id, title: data.title, color: '#76A68F'}) + break + case 14: + totalColors.push({id: data.id, title: data.title, color: '#325943'}) + break + case 19: + totalColors.push({id: data.id, title: data.title, color: '#D99C52'}) + break + case 15: + totalColors.push({id: data.id, title: data.title, color: '#979C9C'}) + break + case 10: + totalColors.push({id: data.id, title: data.title, color: '#E54661'}) + break + case 17: + totalColors.push({id: data.id, title: data.title, color: '#553285'}) + break + case 18: + totalColors.push({id: data.id, title: data.title, color: '#998A2F'}) + break + case 12: + totalColors.push({id: data.id, title: data.title, color: '#35478C'}) + break + case 13: + totalColors.push({id: data.id, title: data.title, color: '#002D40'}) + break + case 8: + totalColors.push({id: data.id, title: data.title, color: '#FF7F66'}) + break + } + console.log(totalColors) + }) + totalColors.forEach(function (colr) { + $('#list').append('