signalk-to-noforeignland 0.1.18 → 0.1.19
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 +4 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -220,6 +220,8 @@ module.exports = function(app) {
|
|
|
220
220
|
// SK sometimes messes up timestamps, when that happens we throw the update
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
|
+
lastPosition = { pos: value.value, timestamp, currentTime: new Date().getTime() };
|
|
224
|
+
|
|
223
225
|
const distance = equirectangularDistance(lastPosition.pos, value.value)
|
|
224
226
|
if (options.minMove && distance < options.minMove) {
|
|
225
227
|
return;
|
|
@@ -228,8 +230,9 @@ module.exports = function(app) {
|
|
|
228
230
|
// app.debug('got error position', value.value, 'ignoring...');
|
|
229
231
|
// return;
|
|
230
232
|
// }
|
|
233
|
+
} else{
|
|
234
|
+
lastPosition = { pos: value.value, timestamp, currentTime: new Date().getTime() };
|
|
231
235
|
}
|
|
232
|
-
lastPosition = { pos: value.value, timestamp, currentTime: new Date().getTime() };
|
|
233
236
|
|
|
234
237
|
await savePoint(lastPosition);
|
|
235
238
|
if (options.minSpeed) {
|