signalk-to-noforeignland 0.1.14 → 0.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +7 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -406,10 +406,13 @@ module.exports = function (app) {
|
|
|
406
406
|
if (line) {
|
|
407
407
|
try {
|
|
408
408
|
const point = JSON.parse(line);
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
|
|
410
|
+
const timestamp = new Date(point.t).getTime();
|
|
411
|
+
if (!isNaN(timestamp) && isValidLatitude(point.lat) && isValidLongitude(point.lon)) {
|
|
412
|
+
track.push([timestamp, point.lat, point.lon]);
|
|
413
|
+
lastTimestamp = timestamp;
|
|
414
|
+
}
|
|
415
|
+
|
|
413
416
|
} catch (error) {
|
|
414
417
|
app.debug('could not parse line from track file:', line);
|
|
415
418
|
}
|