Working on map view

This commit is contained in:
maciejhirsz
2018-07-14 22:56:20 +02:00
parent bcc7145477
commit 2c073eac19
16 changed files with 308 additions and 64 deletions
+9 -1
View File
@@ -3,6 +3,7 @@ import * as EventEmitter from 'events';
import Node from './Node';
import Chain from './Chain';
import { VERSION, timestamp, Maybe, FeedMessage, Types, idGenerator } from '@dotstats/common';
import { Location } from './location';
const nextId = idGenerator<Types.FeedId>();
const { Actions } = FeedMessage;
@@ -42,7 +43,7 @@ export default class Feed {
public static addedNode(node: Node): FeedMessage.Message {
return {
action: Actions.AddedNode,
payload: [node.id, node.nodeDetails(), node.nodeStats(), node.blockDetails()]
payload: [node.id, node.nodeDetails(), node.nodeStats(), node.blockDetails(), node.nodeLocation()]
};
}
@@ -53,6 +54,13 @@ export default class Feed {
};
}
public static locatedNode(node: Node, location: Location): FeedMessage.Message {
return {
action: Actions.LocatedNode,
payload: [node.id, location.lat, location.lon]
};
}
public static imported(node: Node): FeedMessage.Message {
return {
action: Actions.ImportedBlock,