1
0
Fork 0

Works mostly some weird errors now and then with the lines.

merge-requests/1/head
wgaylord 2018-12-19 16:15:59 -06:00
parent 95b52f7ce2
commit 81dd452588
2 changed files with 6 additions and 7 deletions

Binary file not shown.

View File

@ -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]
}
})