Skip to content

Commit 62f2a29

Browse files
pan map only on new pos for followed vehicle
1 parent 05bc9f2 commit 62f2a29

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

js/tracker.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,6 +1532,11 @@ function update(response) {
15321532
}, 400*i);
15331533
} else if(vehicles[i].updated) {
15341534
updatePolyline(i);
1535+
1536+
if(follow_vehicle == i) {
1537+
panTo(follow_vehicle);
1538+
}
1539+
15351540
updateVehicleInfo(i, vehicles[i].curr_position);
15361541

15371542
// remember last position for each vehicle
@@ -1546,10 +1551,6 @@ function update(response) {
15461551

15471552
// store in localStorage
15481553
offline.set('positions', lastPositions);
1549-
1550-
if(follow_vehicle != -1) {
1551-
panTo(follow_vehicle);
1552-
}
15531554
}
15541555

15551556
if (got_positions && !zoomed_in) {

0 commit comments

Comments
 (0)