@idm-plugin/geo 2.0.3 → 2.0.4

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/dist/index.js CHANGED
@@ -1773,7 +1773,7 @@ class r {
1773
1773
  return z.map((W, q) => {
1774
1774
  W.lng = a.convertToStdLng(W.lng);
1775
1775
  const Y = z[q + 1];
1776
- if (Y && (W.bearing || ((W.positionTime || 0) > (Y.positionTime || 0) ? W.bearing = this.calculateBearing(Y, W, !0) : W.bearing = this.calculateBearing(W, Y, !0)), W.cog = W.cog || W.bearing, !W.sog && W.positionTime && Y.positionTime)) {
1776
+ if (Y && ((W.bearing === null || W.bearing === void 0) && ((W.positionTime || 0) > (Y.positionTime || 0) ? W.bearing = this.calculateBearing(Y, W, !0) : W.bearing = this.calculateBearing(W, Y, !0)), W.cog = W.cog || W.bearing, !W.sog && W.positionTime && Y.positionTime)) {
1777
1777
  const d = this.calculateDistance(W, Y, !0), R = Math.abs(Y.positionTime - W.positionTime) / 3600;
1778
1778
  W.sog = a.roundPrecision(d / R, 2);
1779
1779
  }
@@ -1901,7 +1901,7 @@ class r {
1901
1901
  const W = { lng: a.roundPrecision(A[0], 8), lat: a.roundPrecision(A[1], 8) };
1902
1902
  if (!c)
1903
1903
  b.push(W), c = W;
1904
- else if (c.bearing === void 0)
1904
+ else if (c.bearing === void 0 || c.bearing === null)
1905
1905
  c.bearing = this.calculateBearing(c, W, !0);
1906
1906
  else {
1907
1907
  const q = this.calculateDistance(p, W, !0);