Inital map objects
parent
ec8d2eeca0
commit
94762a8e1a
|
@ -139,7 +139,7 @@ def map_view():
|
||||||
def api_active_stations():
|
def api_active_stations():
|
||||||
sations = []
|
sations = []
|
||||||
for x in Stations:
|
for x in Stations:
|
||||||
sations.append([x["name"],x["lat"],x["lng"]])
|
sations.append([x["name"],[x["lat"],x["lng"]]])
|
||||||
return json.dumps(sations)
|
return json.dumps(sations)
|
||||||
|
|
||||||
@app.route('/stations_from_sat/<string:norad>')
|
@app.route('/stations_from_sat/<string:norad>')
|
||||||
|
|
|
@ -73,6 +73,8 @@ var active_station = L.icon({
|
||||||
}).addTo(mymap);
|
}).addTo(mymap);
|
||||||
|
|
||||||
|
|
||||||
|
Stations = []
|
||||||
|
|
||||||
function UpdateMap(e) {
|
function UpdateMap(e) {
|
||||||
var satPos = e[0]
|
var satPos = e[0]
|
||||||
var links = e[1]
|
var links = e[1]
|
||||||
|
@ -80,38 +82,14 @@ function UpdateMap(e) {
|
||||||
|
|
||||||
$.get("/activestations", function(data, status){
|
$.get("/activestations", function(data, status){
|
||||||
data = JSON.parse(data)
|
data = JSON.parse(data)
|
||||||
Object.keys(data).forEach(function(key){
|
Object.keys(data).forEach(function(x){
|
||||||
sat = light_sat
|
marker = L.marker([1],{icon: station,zIndexOffset:-1000}).addTo(mymap);
|
||||||
if(data[key]["eclipsed"]){
|
marker.bindPopup("<b>Name: "+x[2]+"</b>")
|
||||||
sat = dark_sat
|
|
||||||
}
|
});
|
||||||
if(data[key]["image"] != null){
|
});
|
||||||
image = data[key]["image"]
|
|
||||||
if(data[key]["eclipsed"]){
|
|
||||||
image = image + "-dark.png"
|
|
||||||
}else{
|
|
||||||
image = image + "-light.png"
|
|
||||||
}
|
|
||||||
|
|
||||||
sat = L.icon({
|
|
||||||
iconUrl: image,
|
|
||||||
iconSize: [40, 40],
|
|
||||||
iconAnchor: [20, 20],
|
|
||||||
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;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//Ground Stations
|
|
||||||
// marker = L.marker({{x["lat_lng"]}},{icon: station,zIndexOffset:-1000}).addTo(mymap);
|
|
||||||
//marker.bindPopup("<b>Name: {{x['name']}}</b>")
|
|
||||||
|
|
||||||
//Sats
|
|
||||||
//marker = L.marker(data[key]["lat_lng"],{icon: sat,zIndexOffset:1000}).addTo(mymap);
|
//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"]);
|
//marker.bindPopup("<b>Name: "+data[key]["name"]+"</b><br><b>Norad: "+key+"</b><br><b>Eclipsed?: "+data[key]["eclipsed"]);
|
||||||
//sats[key] = marker;
|
//sats[key] = marker;
|
||||||
|
|
Loading…
Reference in New Issue