@@ -1378,21 +1378,7 @@ function updateVehicleInfo(vcallsign, newPosition) {
13781378 hrate_text = imp ? ( vehicle . horizontal_rate * 196.850394 ) . toFixed ( 1 ) + ' ft/min' : vehicle . horizontal_rate . toFixed ( 1 ) + ' m/s' ;
13791379 }
13801380
1381- var coords_text ;
1382- var ua = navigator . userAgent . toLowerCase ( ) ;
1383-
1384- // determine how to link the vehicle coordinates to a native app, if on a mobile device
1385- if ( ua . indexOf ( 'iphone' ) > - 1 ) {
1386- coords_text = '<a id="launch_mapapp" href="maps://?q=' + newPosition . gps_lat + ',' + newPosition . gps_lon + '">' +
1387- roundNumber ( newPosition . gps_lat , 5 ) + ', ' + roundNumber ( newPosition . gps_lon , 5 ) + '</a>' +
1388- ' <i class="icon-location"></i>' ;
1389- } else if ( ua . indexOf ( 'android' ) > - 1 ) {
1390- coords_text = '<a id="launch_mapapp" href="geo:' + newPosition . gps_lat + ',' + newPosition . gps_lon + '?q=' + newPosition . gps_lat + ',' + newPosition . gps_lon + '(' + vcallsign + ')">' +
1391- roundNumber ( newPosition . gps_lat , 5 ) + ', ' + roundNumber ( newPosition . gps_lon , 5 ) + '</a>' +
1392- ' <i class="icon-location"></i>' ;
1393- } else {
1394- coords_text = roundNumber ( newPosition . gps_lat , 5 ) + ', ' + roundNumber ( newPosition . gps_lon , 5 ) ;
1395- }
1381+ var coords_text = format_coordinates ( newPosition . gps_lat , newPosition . gps_lon , vcallsign ) + ' <i class="icon-location"></i>' ;
13961382
13971383 // format altitude strings
13981384 var text_alt = Number ( ( imp ) ? Math . floor ( 3.2808399 * parseInt ( newPosition . gps_alt ) ) : parseInt ( newPosition . gps_alt ) ) . toLocaleString ( "us" ) ;
@@ -2246,7 +2232,7 @@ function mapInfoBox_handle_path_new(data, vehicle, date) {
22462232 html = "<div style='line-height:16px;position:relative;'>" ;
22472233 html += "<div>" + data . vehicle + " <span style=''>(" + date + ")</span></div>" ;
22482234 html += "<hr style='margin:5px 0px'>" ;
2249- html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + roundNumber ( data . gps_lat , 5 ) + ', ' + roundNumber ( data . gps_lon , 5 ) + "</div>" ;
2235+ html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + format_coordinates ( data . gps_lat , data . gps_lon , data . vehicle ) + "</div>" ;
22502236
22512237 var imp = offline . get ( 'opt_imperial' ) ;
22522238 var text_alt = Number ( ( imp ) ? Math . floor ( 3.2808399 * parseInt ( data . gps_alt ) ) : parseInt ( data . gps_alt ) ) . toLocaleString ( "us" ) ;
@@ -2345,20 +2331,7 @@ function mapInfoBox_handle_prediction(event) {
23452331 altitude = Math . round ( data . alt ) + " m" ;
23462332 }
23472333
2348- var coords_text ;
2349- var ua = navigator . userAgent . toLowerCase ( ) ;
2350-
2351- // determine how to link the vehicle coordinates to a native app, if on a mobile device
2352- if ( ua . indexOf ( 'iphone' ) > - 1 ) {
2353- coords_text = '<a href="maps://?q=' + data . lat + ',' + data . lon + '">' +
2354- roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + '</a>' ;
2355- } else if ( ua . indexOf ( 'android' ) > - 1 ) {
2356- coords_text = '<a href="geo:' + data . lat + ',' + data . lon + '?q=' + data . lat + ',' + data . lon + '(Prediction)">' +
2357- roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + '</a>' ;
2358- } else {
2359- coords_text = '<a href="https://www.google.com/maps/search/?api=1&query=' + data . lat + ',' + data . lon + '" target="_blank" rel="noopener noreferrer">' +
2360- roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + '</a>' ;
2361- }
2334+ var coords_text = format_coordinates ( data . lat , data . lon , "Prediction" ) ;
23622335
23632336 mapInfoBox . setContent ( "<pre>" +
23642337 formatDate ( new Date ( parseInt ( data . time ) * 1000 ) , true ) + "\n\n" +
0 commit comments