fleetmap-reports 1.0.292 → 1.0.293
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/package.json +1 -1
- package/src/speeding-report.js +3 -2
package/package.json
CHANGED
package/src/speeding-report.js
CHANGED
|
@@ -242,9 +242,10 @@ async function getHereEvents(devices, routes, threshold){
|
|
|
242
242
|
console.log('no positions on device', d.name)
|
|
243
243
|
continue
|
|
244
244
|
}
|
|
245
|
+
let hereAlerts = null
|
|
245
246
|
try {
|
|
246
247
|
const results = await here.routeMatch(positions)
|
|
247
|
-
|
|
248
|
+
hereAlerts = results.filter(r => r.currentSpeedKmh > (parseInt(r.speedLimit) + threshold)).map(r => {
|
|
248
249
|
const position = positions.find(p => new Date(p.fixTime).getTime() === r.timestamp)
|
|
249
250
|
return {
|
|
250
251
|
...r,
|
|
@@ -270,7 +271,7 @@ async function getHereEvents(devices, routes, threshold){
|
|
|
270
271
|
})
|
|
271
272
|
events.push(...reduced)
|
|
272
273
|
} catch (e) {
|
|
273
|
-
console.error(e)
|
|
274
|
+
console.error(hereAlerts, e)
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
277
|
return events
|