map: make sure source callsign is trimmed

since the library seems to not do this...
This commit is contained in:
Adam Goldsmith 2018-08-09 20:47:37 -04:00
parent c5cf330238
commit adfc16c917
1 changed files with 3 additions and 3 deletions

View File

@ -58,9 +58,9 @@ function plotPaths(packets) {
.filter(packet => 'data' in packet && 'latitude' in packet.data)
// join into Arrays of points
.reduce((acc, packet) => {
if (!acc.has(packet.from.toString())) acc.set(packet.from.toString(), []);
acc.get(packet.from.toString()).push([packet.data.longitude,
packet.data.latitude]);
let callsign = packet.from.toString().trim();
if (!acc.has(callsign)) acc.set(callsign, []);
acc.get(callsign).push([packet.data.longitude, packet.data.latitude]);
return acc;
}, new Map());