File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ var got_positions = false;
2020var zoomed_in = false ;
2121var max_positions = 0 ; // maximum number of positions that ajax request should return (0 means no maximum)
2222var follow_vehicle = null ;
23+ var manual_pan = false ;
2324
2425var car_index = 0 ;
2526var car_colors = [ "blue" , "red" , "green" , "yellow" ] ;
@@ -357,6 +358,10 @@ function load() {
357358 updateZoom ( ) ;
358359 } ) ;
359360
361+ google . maps . event . addListener ( map , 'dragstart' , function ( ) {
362+ manual_pan = true ;
363+ } ) ;
364+
360365 // only start population the map, once its completely loaded
361366 google . maps . event . addListenerOnce ( map , 'idle' , function ( ) {
362367 startAjax ( ) ;
@@ -611,6 +616,7 @@ function followVehicle(vcallsign) {
611616 updateGraph ( vcallsign , true ) ;
612617 }
613618
619+ manual_pan = false ;
614620 panTo ( vcallsign ) ;
615621}
616622
@@ -2038,7 +2044,7 @@ function update(response) {
20382044 ctx . lastPPointer . push ( vehicle . curr_position ) ;
20392045
20402046 if ( listScroll ) listScroll . refresh ( ) ;
2041- if ( zoomed_in && follow_vehicle == vcallsign ) panTo ( follow_vehicle ) ;
2047+ if ( zoomed_in && follow_vehicle == vcallsign && ! manual_pan ) panTo ( follow_vehicle ) ;
20422048 }
20432049
20442050 // step to the next callsign
You can’t perform that action at this time.
0 commit comments