Designed with postermywall
Brief about the ISS
The International Space Station (ISS) is a habitable artificial satellite in low Earth orbit. It was launched in 1998 and has been continuously occupied by astronauts from around the world since 2000 ( the year I was born). The ISS is a collaboration between five space agencies: NASA, Roscosmos, JAXA, ESA, and CSA. The station serves as a research laboratory for scientists to conduct experiments in astronomy, meteorology, and other fields. The ISS orbits the Earth at a height of approximately 408 km and completes one orbit every 90 minutes. Source
Before we get started, below are all the things needed to achieve our goal of tracking the ISS's location.
- Code Editor ( Ich bin ein VS-Code-Editor)
- Browser ( I am using Mozilla Firefox)4. API endpoint of ISS
Let's get started
STEP 1: Initializing the Project.
STEP 2 :Initializing the HTML file to display the map on a webpage.
Here, we will write HTML code that will display the contents of whatever we will be creating on the webpage. The HTML file I have created contains the title of our webpage and the contents we want to display on the webpage.
This is the point where we will fetch the data about the current location of the ISS from the API. Before you will be able to use an API, it is recommended that you read its documentation for guidance on how to get the data you need, even if you already have information about it as there might be some changes since the last time you used it.
According to the documentation from
https://wheretheiss.at/w/developer , the API endpoint from which we can get the longitude and latitude is
I created a function named "getISS," which fetches the data from the ISS API that we can use for the map. I set the interval to 1 second so that we will have updated data every second as it moves
STEP 5: Adding LeafletJS to the Webpage
STEP 6 : Using the Data we got from the API to Plot the Map with LeafletJS
I hope you found this useful. I am Abdul-Salam Issahaku, from Ghana. I am a student web developer and a blockchain enthusiast. I blog about technology and investments. You can follow me to be part of my Hive family. Thank you for your time.
All images used in this post are screenshots from visual studio code.