Display location on map node details

This commit is contained in:
maciejhirsz
2018-07-18 16:59:47 +02:00
parent 3696d7c46e
commit 5c1480f9f5
11 changed files with 30 additions and 17 deletions
+1 -5
View File
@@ -98,8 +98,6 @@ export default class Node {
return;
}
console.log('node', ip, 'located at', location);
this.location = location;
this.events.emit('location', location);
@@ -107,8 +105,6 @@ export default class Node {
}
public static fromSocket(socket: WebSocket, ip: string): Promise<Node> {
console.log('node ip', ip);
return new Promise((resolve, reject) => {
function cleanup() {
clearTimeout(timeout);
@@ -160,7 +156,7 @@ export default class Node {
public nodeLocation(): Maybe<Types.NodeLocation> {
const { location } = this;
return location ? [location.lat, location.lon] : null;
return location ? [location.lat, location.lon, location.city] : null;
}
public get average(): number {