File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -90,13 +90,26 @@ const generateNeighborLines = (
90
90
} ;
91
91
} ;
92
92
const generateDirectLines = ( nodes : Protobuf . Mesh . NodeInfo [ ] ) => {
93
- const features = [ ] ;
93
+ const selfNode = nodes . find ( ( n ) => n . isFavorite ) ;
94
+ const features : {
95
+ type : string ;
96
+ geometry : {
97
+ type : string ;
98
+ coordinates : number [ ] [ ] ;
99
+ } ;
100
+ properties : {
101
+ color : string ;
102
+ } ;
103
+ } [ ] = [ ] ;
104
+
105
+ if ( ! selfNode || ! selfNode . position )
106
+ return { type : "FeatureCollection" , features } ;
107
+
94
108
for ( const node of nodes ) {
95
109
if ( ! node . position ) continue ;
96
110
if ( node . hopsAway > 0 ) continue ;
97
111
if ( Date . now ( ) / 1000 - node . lastHeard > DIRECT_NODE_TIMEOUT ) continue ;
98
112
const start = convertToLatLng ( node . position ) ;
99
- const selfNode = nodes . find ( ( n ) => n . isFavorite ) ;
100
113
const end = convertToLatLng ( selfNode . position ) ;
101
114
features . push ( {
102
115
type : "Feature" ,
You can’t perform that action at this time.
0 commit comments