Works mostly some weird errors now and then with the lines.
parent
95b52f7ce2
commit
81dd452588
Binary file not shown.
|
@ -91,7 +91,8 @@ function UpdateMap(e) {
|
|||
var name = e.data[1]
|
||||
var satPos = e.data[2]
|
||||
if (norad in Sats){
|
||||
|
||||
Sats[norad]._latlng = {"lat":satPos[0],"lng":satPos[1]}
|
||||
Sats[norad].update()
|
||||
}else{
|
||||
Sats[norad] = L.marker(satPos,{icon: dark_sat,zIndexOffset:1000}).addTo(mymap);
|
||||
Sats[norad].bindPopup("<b>Name: "+name+"</b><br><b>Norad: "+norad+"</b>");
|
||||
|
@ -101,15 +102,13 @@ function UpdateMap(e) {
|
|||
Lines[norad][x].addTo(mymap)
|
||||
});
|
||||
}
|
||||
Sats[norad]._latlng = {"lat":satPos[0],"lng":satPos[1]}
|
||||
Sats[norad].update()
|
||||
|
||||
Object.keys(Lines[norad]).forEach(function(x){
|
||||
if (e.data[3].includes(x)){
|
||||
if (e.data[3].includes(Number(x))){
|
||||
Lines[norad][x]._latlngs[1]= {"lat":satPos[0],"lng":satPos[1]}
|
||||
Lines[norad][x].update()
|
||||
}else{
|
||||
|
||||
|
||||
Lines[norad][x].removeFrom(mymap)
|
||||
delete Lines[norad][x]
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in New Issue