1
0
Fork 0

Fixed lines

merge-requests/1/head
wgaylord 2018-12-22 02:09:23 -06:00
parent ef9ca1e336
commit 7d918adff0
1 changed files with 19 additions and 11 deletions

View File

@ -13,6 +13,12 @@
<style>
#mapid { height: 700px; }
.trans {
/* This value is the OPPOSITE color of our background */
color: rgb(255, 255, 255);
mix-blend-mode: difference;
}
</style>
<div class="container">
@ -105,7 +111,7 @@ function UpdateMap(e) {
e.data[4].forEach(function(x){
//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]._popup.setContent(popupText)
@ -116,20 +122,22 @@ function UpdateMap(e) {
})
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){
if (temp.includes(Number(y))){
Lines[norad][y]._latlngs[1]= {"lat":satPos[0],"lng":satPos[1]}
}else{
Lines[norad][y].removeFrom(mymap)
delete Lines[norad][y]
}
Lines[norad][y]._latlngs[1]= {"lat":satPos[0],"lng":satPos[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)};
})
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{
Workers[x].terminate()
delete Workers[x]
UpdateMap({"data":[x,"",[0,0],[]]})
UpdateMap({"data":[x,"",[0,0],[],[]]})
Sats[x].removeFrom(mymap)
delete Sats[x]
delete Lines[x]