We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d02f537 commit 74e2502Copy full SHA for 74e2502
js/tracker.js
@@ -2212,10 +2212,12 @@ function addPosition(position) {
2212
var curr_ts = convert_time(vehicle.curr_position.gps_time);
2213
var dt = (new_ts - curr_ts) / 1000; // convert to seconds
2214
2215
- if (position.type.length < vehicle.curr_position.type) {
2216
- 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) {
2217
+ position.type = vehicle.curr_position.type;
2218
+ }
2219
}
-
2220
+
2221
if(dt >= 0) {
2222
if(vehicle.num_positions > 0) {
2223
// calculate vertical rate
0 commit comments