Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
check is defined
  • Loading branch information
LukePrior committed Jul 25, 2021
commit 74e2502e3e9b7d92325fc0308e82bc8bab43cded
8 changes: 5 additions & 3 deletions js/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -2212,10 +2212,12 @@ function addPosition(position) {
var curr_ts = convert_time(vehicle.curr_position.gps_time);
var dt = (new_ts - curr_ts) / 1000; // convert to seconds

if (position.type.length < vehicle.curr_position.type) {
position.type.length = vehicle.curr_position.type;
if (typeof position.type !== 'undefined' && typeof vehicle.curr_position.type !== 'undefined') {
if (position.type.length < vehicle.curr_position.type.length) {
position.type = vehicle.curr_position.type;
}
}

if(dt >= 0) {
if(vehicle.num_positions > 0) {
// calculate vertical rate
Expand Down