Fixed lines
parent
ef9ca1e336
commit
7d918adff0
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue