fleetmap-reports 1.0.931 → 1.0.932

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.931",
3
+ "version": "1.0.932",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -30,7 +30,10 @@ function getDeviceData (allInOne, d, user, minDistance) {
30
30
  return deviceRoute.map((pA, index) => {
31
31
  if (index < deviceRoute.length - 1) {
32
32
  const pB = deviceRoute[index + 1]
33
- const distanceValue = distance.default([pA.longitude, pA.latitude], [pB.longitude, pB.latitude], { units: 'meters' })
33
+ let distanceValue = pA.attributes.distance
34
+ if ((minDistance * 1000) >= pA.attributes.distance) {
35
+ distanceValue = distance.default([pA.longitude, pA.latitude], [pB.longitude, pB.latitude], { units: 'meters' })
36
+ }
34
37
 
35
38
  return {
36
39
  device: d.name,