Fixed lines
parent
ef9ca1e336
commit
7d918adff0
|
@ -13,6 +13,12 @@
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#mapid { height: 700px; }
|
#mapid { height: 700px; }
|
||||||
|
|
||||||
|
.trans {
|
||||||
|
/* This value is the OPPOSITE color of our background */
|
||||||
|
color: rgb(255, 255, 255);
|
||||||
|
mix-blend-mode: difference;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -105,7 +111,7 @@ function UpdateMap(e) {
|
||||||
|
|
||||||
e.data[4].forEach(function(x){
|
e.data[4].forEach(function(x){
|
||||||
//console.log(x + " "+norad)
|
//console.log(x + " "+norad)
|
||||||
popupText = popupText + '<div style="background-color:'+x[1]+'";>'+x[0]+"</div><br>"
|
popupText = popupText + '<div class="trans" style="background-color:'+x[1]+'";>'+x[0]+"</div>"
|
||||||
})
|
})
|
||||||
Sats[norad].bindPopup(popupText)
|
Sats[norad].bindPopup(popupText)
|
||||||
Sats[norad]._popup.setContent(popupText)
|
Sats[norad]._popup.setContent(popupText)
|
||||||
|
@ -116,20 +122,22 @@ function UpdateMap(e) {
|
||||||
})
|
})
|
||||||
|
|
||||||
e.data[3].forEach(function(x){
|
e.data[3].forEach(function(x){
|
||||||
if (Object.keys(Lines[norad]).includes(Number(x[0]))){
|
if (Object.keys(Lines[norad]).includes(String(x[0]))){
|
||||||
Object.keys(Lines[norad]).forEach(function(y){
|
Object.keys(Lines[norad]).forEach(function(y){
|
||||||
if (temp.includes(Number(y))){
|
Lines[norad][y]._latlngs[1]= {"lat":satPos[0],"lng":satPos[1]}
|
||||||
Lines[norad][y]._latlngs[1]= {"lat":satPos[0],"lng":satPos[1]}
|
|
||||||
}else{
|
|
||||||
Lines[norad][y].removeFrom(mymap)
|
|
||||||
delete Lines[norad][y]
|
|
||||||
}
|
|
||||||
|
|
||||||
})}else{Lines[norad][x[0]] = new L.Polyline([[Stations[x[0]]._latlng.lat,Stations[x[0]]._latlng.lng],[satPos[0],satPos[1]]], {color: x[1],weight: 3,opacity: 1,smoothFactor: 1});
|
})}else{Lines[norad][x[0]] = new L.Polyline([[Stations[x[0]]._latlng.lat,Stations[x[0]]._latlng.lng],[satPos[0],satPos[1]]], {color: x[1],weight: 3,opacity: 1,smoothFactor: 1});
|
||||||
Lines[norad][x[0]].addTo(mymap)};
|
Lines[norad][x[0]].addTo(mymap)};
|
||||||
})
|
})
|
||||||
|
Object.keys(Lines[norad]).forEach(function(x){
|
||||||
|
if (temp.includes(Number(x))){
|
||||||
|
|
||||||
|
}else{
|
||||||
|
Lines[norad][x].removeFrom(mymap)
|
||||||
|
delete Lines[norad][x]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +181,7 @@ $.get("/occuring_sats", function(data, status){
|
||||||
}else{
|
}else{
|
||||||
Workers[x].terminate()
|
Workers[x].terminate()
|
||||||
delete Workers[x]
|
delete Workers[x]
|
||||||
UpdateMap({"data":[x,"",[0,0],[]]})
|
UpdateMap({"data":[x,"",[0,0],[],[]]})
|
||||||
Sats[x].removeFrom(mymap)
|
Sats[x].removeFrom(mymap)
|
||||||
delete Sats[x]
|
delete Sats[x]
|
||||||
delete Lines[x]
|
delete Lines[x]
|
||||||
|
|
Loading…
Reference in New Issue