Skip to content

Commit eb0718c

Browse files
committed
fix infinite horizontal speed
1 parent 858cd9d commit eb0718c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/tracker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2230,7 +2230,7 @@ function addPosition(position) {
22302230

22312231
// calculate horizontal rate
22322232
horizontal_rate_temp = new_latlng.distanceTo(new L.LatLng(vehicle.curr_position.gps_lat, vehicle.curr_position.gps_lon)) / dt;
2233-
if (!isNaN(horizontal_rate_temp)) {
2233+
if (!isNaN(horizontal_rate_temp) && dt != 0) {
22342234
vehicle.horizontal_rate = horizontal_rate_temp;
22352235
}
22362236
}

0 commit comments

Comments
 (0)