fleetmap-reports 1.0.956 → 1.0.957

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.956",
3
+ "version": "1.0.957",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -22,13 +22,15 @@ function getNearestPOIs (long, lat, geofences) {
22
22
  .filter(g => g && g.area.startsWith('CIRCLE'))
23
23
  .map(g => {
24
24
  const str = g.area.substring('CIRCLE ('.length, g.area.indexOf(','))
25
+ const radius = g.area.substring(g.area.indexOf(',') + 1, g.area.indexOf(')'))
25
26
  const coord = str.trim().split(' ')
26
27
  return {
27
28
  p: g,
28
- distance: Math.round(coordsDistance(parseFloat(coord[1]), parseFloat(coord[0]), long, lat))
29
+ distance: Math.round(coordsDistance(parseFloat(coord[1]), parseFloat(coord[0]), long, lat)),
30
+ r: parseFloat(radius)
29
31
  }
30
32
  })
31
- return distance.filter(a => a.distance < 100).sort((a, b) => (a.distance > b.distance) ? 1 : -1)
33
+ return distance.filter(a => a.distance < a.r).sort((a, b) => (a.distance > b.distance) ? 1 : -1)
32
34
  }
33
35
  exports.getNearestPOIs = getNearestPOIs
34
36