@@ -1799,23 +1799,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
17991799 hrate_text = imp ? ( vehicle . horizontal_rate * 196.850394 ) . toFixed ( 1 ) + ' ft/min' : vehicle . horizontal_rate . toFixed ( 1 ) + ' m/s' ;
18001800 }
18011801
1802- var coords_text ;
1803- var ua = navigator . userAgent . toLowerCase ( ) ;
1804-
1805- // determine how to link the vehicle coordinates to a native app, if on a mobile device
1806- if ( ua . indexOf ( 'iphone' ) > - 1 ) {
1807- coords_text = '<a href="maps://?q=' + newPosition . gps_lat + ',' + newPosition . gps_lon + '">' +
1808- roundNumber ( newPosition . gps_lat , 5 ) + ', ' + roundNumber ( newPosition . gps_lon , 5 ) + '</a>' +
1809- ' <i class="icon-location"></i>' ;
1810- } else if ( ua . indexOf ( 'android' ) > - 1 ) {
1811- coords_text = '<a href="geo:' + newPosition . gps_lat + ',' + newPosition . gps_lon + '?q=' + newPosition . gps_lat + ',' + newPosition . gps_lon + '(' + vcallsign + ')">' +
1812- roundNumber ( newPosition . gps_lat , 5 ) + ', ' + roundNumber ( newPosition . gps_lon , 5 ) + '</a>' +
1813- ' <i class="icon-location"></i>' ;
1814- } else {
1815- coords_text = '<a href="https://www.google.com/maps/search/?api=1&query=' + newPosition . gps_lat + ',' + newPosition . gps_lon + '" target="_blank" rel="noopener noreferrer">' +
1816- roundNumber ( newPosition . gps_lat , 5 ) + ', ' + roundNumber ( newPosition . gps_lon , 5 ) + '</a>' +
1817- ' <i class="icon-location"></i>' ;
1818- }
1802+ var coords_text = format_coordinates ( newPosition . gps_lat , newPosition . gps_lon , vcallsign ) + ' <i class="icon-location"></i>' ;
18191803
18201804 // format altitude strings
18211805 var text_alt = Number ( ( imp ) ? Math . floor ( 3.2808399 * parseInt ( newPosition . gps_alt ) ) : parseInt ( newPosition . gps_alt ) ) . toLocaleString ( "us" ) ;
@@ -2931,20 +2915,7 @@ function mapInfoBox_handle_prediction(event) {
29312915 altitude = Math . round ( data . alt ) + " m" ;
29322916 }
29332917
2934- var coords_text ;
2935- var ua = navigator . userAgent . toLowerCase ( ) ;
2936-
2937- // determine how to link the vehicle coordinates to a native app, if on a mobile device
2938- if ( ua . indexOf ( 'iphone' ) > - 1 ) {
2939- coords_text = '<a href="maps://?q=' + data . lat + ',' + data . lon + '">' +
2940- roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + '</a>' ;
2941- } else if ( ua . indexOf ( 'android' ) > - 1 ) {
2942- coords_text = '<a href="geo:' + data . lat + ',' + data . lon + '?q=' + data . lat + ',' + data . lon + '(Prediction)">' +
2943- roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + '</a>' ;
2944- } else {
2945- coords_text = '<a href="https://www.google.com/maps/search/?api=1&query=' + data . lat + ',' + data . lon + '" target="_blank" rel="noopener noreferrer">' +
2946- roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + '</a>' ;
2947- }
2918+ var coords_text = format_coordinates ( data . lat , data . lon , "Prediction" ) ;
29482919
29492920 mapInfoBox . setContent ( "<pre>" +
29502921 formatDate ( new Date ( parseInt ( data . time ) * 1000 ) , true ) + "\n\n" +
0 commit comments