fleetmap-reports 1.0.483 → 1.0.484

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetmap-reports",
3
- "version": "1.0.483",
3
+ "version": "1.0.484",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -293,8 +293,8 @@ async function getHereEvents (devices, routes, threshold) {
293
293
  const reduced = results.reduce((acc, cur, idx, src) => {
294
294
  cur.overSpeeding = cur.currentSpeedKmh > parseInt(cur.speedLimit) + (threshold || 0)
295
295
  const last = acc.length && acc.slice(-1)[0]
296
+ cur.position = positions.find(p => new Date(p.fixTime).getTime() === cur.timestamp)
296
297
  if (cur.overSpeeding && last && src[idx - 1].overSpeeding && last.speedLimit === cur.speedLimit) {
297
- cur.position = positions.find(p => new Date(p.fixTime).getTime() === cur.timestamp)
298
298
  last.eventTime = cur.timestamp - last.timestamp
299
299
  last.attributes.maxSpeed = Math.max(last.attributes.maxSpeed, cur.position.speed)
300
300
  last.distance = distance.default(point([cur.position.longitude, cur.position.latitude]), point([last.position.longitude, last.position.latitude]))