signalk-to-noforeignland 0.1.19 → 0.1.21
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 +3 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -221,6 +221,7 @@ module.exports = function(app) {
|
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
223
|
lastPosition = { pos: value.value, timestamp, currentTime: new Date().getTime() };
|
|
224
|
+
app.debug('Updated lastPosition:', lastPosition);
|
|
224
225
|
|
|
225
226
|
const distance = equirectangularDistance(lastPosition.pos, value.value)
|
|
226
227
|
if (options.minMove && distance < options.minMove) {
|
|
@@ -394,7 +395,7 @@ module.exports = function(app) {
|
|
|
394
395
|
return;
|
|
395
396
|
}
|
|
396
397
|
const url = options.apiUrl || "https://www.noforeignland.com/home/api/v1/boat/tracking/track";
|
|
397
|
-
const timestamp =
|
|
398
|
+
const timestamp = Date.now();//we want to trigger a refresh on NFL even if we didn't get a delta
|
|
398
399
|
const lat = lastPosition.pos.latitude;
|
|
399
400
|
const lon = lastPosition.pos.longitude;
|
|
400
401
|
|
|
@@ -445,7 +446,7 @@ module.exports = function(app) {
|
|
|
445
446
|
}
|
|
446
447
|
|
|
447
448
|
async function sendApiData() {
|
|
448
|
-
const url = options.apiUrl;
|
|
449
|
+
const url = options.apiUrl || "https://www.noforeignland.com/home/api/v1/boat/tracking/track";
|
|
449
450
|
app.debug('sending to ' + url)
|
|
450
451
|
app.debug('sending the data');
|
|
451
452
|
const trackData = await createTrack(path.join(options.trackDir, routeSaveName));
|