@@ -1009,7 +1009,7 @@ function addPosition(position) {
10091009
10101010function refresh ( ) {
10111011 status = '<img src="spinner.gif" width="16" height="16" alt="" /> Refreshing ...' ;
1012- $ ( '#status_bar' ) . html ( status ) ;
1012+ // $('#status_bar').html(status);
10131013
10141014 $ . ajax ( {
10151015 type : "GET" ,
@@ -1018,18 +1018,18 @@ function refresh() {
10181018 dataType : "json" ,
10191019 success : function ( response , textStatus ) {
10201020 update ( response ) ;
1021- $ ( '#status_bar' ) . html ( status ) ;
1021+ // $('#status_bar').html(status);
10221022 } ,
10231023 complete : function ( request , textStatus ) {
10241024 // remove the spinner
1025- $ ( 'status_bar' ) . removeClass ( 'ajax_loading' ) ;
1025+ // $('status_bar').removeClass('ajax_loading');
10261026 periodical = setTimeout ( refresh , timer_seconds * 1000 ) ;
10271027 }
10281028 } ) ;
10291029}
10301030
10311031function refreshReceivers ( ) {
1032- $ ( '#status_bar' ) . html ( '<img src="spinner.gif" width="16" height="16" alt="" /> Refreshing receivers ...' ) ;
1032+ // $('#status_bar').html('<img src="spinner.gif" width="16" height="16" alt="" /> Refreshing receivers ...');
10331033
10341034 $ . ajax ( {
10351035 type : "GET" ,
@@ -1041,15 +1041,15 @@ function refreshReceivers() {
10411041 } ,
10421042 complete : function ( request , textStatus ) {
10431043 // remove the spinner
1044- $ ( 'status_bar' ) . removeClass ( 'ajax_loading' ) ;
1045- $ ( '#status_bar' ) . html ( status ) ;
1044+ // $('status_bar').removeClass('ajax_loading');
1045+ // $('#status_bar').html(status);
10461046 periodical_listeners = setTimeout ( refreshReceivers , 60 * 1000 ) ;
10471047 }
10481048 } ) ;
10491049}
10501050
10511051function refreshPredictions ( ) {
1052- $ ( '#status_bar' ) . html ( '<img src="spinner.gif" width="16" height="16" alt="" /> Refreshing predictions ...' ) ;
1052+ // $('#status_bar').html('<img src="spinner.gif" width="16" height="16" alt="" /> Refreshing predictions ...');
10531053
10541054 $ . ajax ( {
10551055 type : "GET" ,
@@ -1061,8 +1061,8 @@ function refreshPredictions() {
10611061 } ,
10621062 complete : function ( request , textStatus ) {
10631063 // remove the spinner
1064- $ ( 'status_bar' ) . removeClass ( 'ajax_loading' ) ;
1065- $ ( '#status_bar' ) . html ( status ) ;
1064+ // $('status_bar').removeClass('ajax_loading');
1065+ // $('#status_bar').html(status);
10661066 periodical_predictions = setTimeout ( refreshPredictions , 2 * timer_seconds * 1000 ) ;
10671067 }
10681068 } ) ;
@@ -1078,7 +1078,7 @@ function startAjax() {
10781078 clearTimeout ( periodical_predictions ) ;
10791079
10801080 /* a bit of fancy styles */
1081- $ ( 'status_bar' ) . innerHTML = '<img src="spinner.gif" width="16" height="16" alt="" /> Refreshing ...' ;
1081+ // $('status_bar').innerHTML = '<img src="spinner.gif" width="16" height="16" alt="" /> Refreshing ...';
10821082
10831083 // the periodical starts here, the * 1000 is because milliseconds required
10841084
@@ -1098,14 +1098,34 @@ function stopAjax() {
10981098}
10991099
11001100function centerAndZoomOnBounds ( bounds ) {
1101- var center = bounds . getCenter ( ) ;
1102- var newZoom = map . getBoundsZoomLevel ( bounds ) ;
1103- if ( map . getZoom ( ) != newZoom ) {
1104- map . setCenter ( center , newZoom ) ;
1105- } else {
1106- map . panTo ( center ) ;
1101+ var center = bounds . getCenter ( ) ;
1102+ var newZoom = map . getBoundsZoomLevel ( bounds ) ;
1103+ if ( map . getZoom ( ) != newZoom ) {
1104+ map . setCenter ( center , newZoom ) ;
1105+ } else {
1106+ map . panTo ( center ) ;
1107+ }
11071108}
1109+
1110+ var currentPosition = null ;
1111+
1112+ function updateCurrentPosition ( lat , lon ) {
1113+ var latlng = new GLatLng ( lat , lon ) ;
1114+
1115+ if ( ! currentPosition ) {
1116+ currentPosition = { icon : null , marker : null } ;
1117+ currentPosition . icon = new GIcon ( ) ;
1118+ currentPosition . icon . image = "img/marker-you.png" ;
1119+ currentPosition . icon . iconSize = new GSize ( 19 , 40 ) ;
1120+ currentPosition . icon . iconAnchor = new GPoint ( 13 , 40 ) ;
1121+ //currentPosition.icon.infoWindowAnchor = new GPoint(18,5);
1122+ currentPosition . marker = new GMarker ( latlng , { icon : currentPosition . icon } ) ;
1123+ map . addOverlay ( currentPosition . marker ) ;
1124+ } else {
1125+ currentPosition . marker . setLatLng ( latlng ) ;
1126+ }
11081127}
1128+
11091129function updateReceiverMarker ( receiver ) {
11101130 var latlng = new GLatLng ( receiver . lat , receiver . lon ) ;
11111131 if ( ! receiver . marker ) {
0 commit comments