diff --git a/www/Coordinates.js b/www/Coordinates.js index 59ee6e2c..6ef21662 100644 --- a/www/Coordinates.js +++ b/www/Coordinates.js @@ -50,11 +50,11 @@ const Coordinates = function (lat, lng, alt, acc, head, vel, altacc) { /** * The direction the device is moving at the position. */ - this.heading = head !== undefined ? head : null; + this.heading = (typeof head === 'number' && head >= 0 && head <= 360 ? head : null); /** * The velocity with which the device is moving at the position. */ - this.speed = vel !== undefined ? vel : null; + this.speed = (typeof vel === 'number' && vel >= 0 ? vel : null); if (this.speed === 0 || this.speed === null) { this.heading = NaN;