diff --git a/satnogs.py b/satnogs.py index 0d08a82..f287194 100644 --- a/satnogs.py +++ b/satnogs.py @@ -181,7 +181,7 @@ def api_occuring_sats(): satellite.compute(now) lat = satellite.sublat*57.295779514 long = satellite.sublong*57.295779514 - obs[x.satellite['norad_cat_id']] = {"name":x.satellite["name"],"lat_lng":[lat,long],"eclipsed":satellite.eclipsed} + obs[x.satellite['norad_cat_id']] = {"name":x.satellite["name"],"lat_lng":[lat,long],"eclipsed":satellite.eclipsed,"image":x.satellite["image"]} return json.dumps(obs) @app.route('/api/satstationpairs') diff --git a/templates/map.html b/templates/map.html index 33821b9..c8e77fa 100644 --- a/templates/map.html +++ b/templates/map.html @@ -103,6 +103,15 @@ var links = {} if(data[key]["eclipsed"]){ sat = dark_sat } + if(data[key]["image"] != null){ + sat = L.icon({ + iconUrl: data[key]["image"], + iconSize: [20, 20], + iconAnchor: [10, 10], + popupAnchor: [0, 0], + + }); + } marker = L.marker(data[key]["lat_lng"],{icon: sat,zIndexOffset:1000}).addTo(mymap); marker.bindPopup("Name: "+data[key]["name"]+"
Norad: "+key+"
Eclipsed?: "+data[key]["eclipsed"]); sats[key] = marker; @@ -148,6 +157,15 @@ setInterval(function(){ if(data[key]["eclipsed"]){ sat = dark_sat } + if(data[key]["image"] != null){ + sat = L.icon({ + iconUrl: data[key]["image"], + iconSize: [20, 20], + iconAnchor: [10, 10], + popupAnchor: [0, 0], + + }); + } marker = L.marker(data[key]["lat_lng"],{icon: sat,zIndexOffset:1000}).addTo(mymap); marker.bindPopup("Name: "+data[key]["name"]+"
Norad: "+key+"
Eclipsed?: "+data[key]["eclipsed"]); sats[key] = marker;