Skip to content

Commit

Permalink
added location of iss
Browse files Browse the repository at this point in the history
  • Loading branch information
vachan-maker committed Aug 18, 2024
1 parent 790d638 commit 2330ae7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Binary file added assets/space-station.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions iss.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
<div id="map"></div>
</main>
<script>
let latitude, longitude;
let longitude;
let latitude;
async function trackISS() {
try {
const response = await fetch('https://api.wheretheiss.at/v1/satellites/25544');
Expand All @@ -47,16 +48,15 @@
const data = await response.json();
console.log(data);
longitude = data.longitude;
atitude = data.latitude;
console.log(longitude);
var marker = L.marker([51.5, -0.09]).addTo(map);
latitude = data.latitude;
var myIcon = L.icon({iconUrl: "assets/space-station.png", iconSize: [38, 95],iconAnchor: [22, 94],popupAnchor: [-3, -76]});
var marker = L.marker([latitude,longitude],{icon: myIcon}).addTo(map);
}
catch (error) {
console.error(error);
}
}
console.log(longitude);
var map = L.map('map').setView([51.505, -0.09], 2)
var map = L.map('map').setView([0, 0], 2)
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
maxZoom: 19,
attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
Expand Down

0 comments on commit 2330ae7

Please sign in to comment.