Display sat image instead of generic sat if there is an image for it.
parent
340d7b032c
commit
161dcf5054
|
@ -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')
|
||||
|
|
|
@ -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("<b>Name: "+data[key]["name"]+"</b><br><b>Norad: "+key+"</b><br><b>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("<b>Name: "+data[key]["name"]+"</b><br><b>Norad: "+key+"</b><br><b>Eclipsed?: "+data[key]["eclipsed"]);
|
||||
sats[key] = marker;
|
||||
|
|
Loading…
Reference in New Issue