@@ -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 id="launch_mapapp" 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 id="launch_mapapp" 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 id="launch_mapapp" 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" ) ;
@@ -2722,7 +2706,7 @@ function mapInfoBox_handle_path_old(vehicle, id) {
27222706 html = "<div style='line-height:16px;position:relative;'>" ;
27232707 html += "<div>" + data . serial + " <span style=''>(" + data . datetime + ")</span></div>" ;
27242708 html += "<hr style='margin:5px 0px'>" ;
2725- html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + "</div>" ;
2709+ html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + format_coordinates ( data . lat , data . lon , data . serial ) + "</div>" ;
27262710
27272711 var imp = offline . get ( 'opt_imperial' ) ;
27282712 var text_alt = Number ( ( imp ) ? Math . floor ( 3.2808399 * parseInt ( data . alt ) ) : parseInt ( data . alt ) ) . toLocaleString ( "us" ) ;
@@ -2797,7 +2781,7 @@ function mapInfoBox_handle_path_new(data, vehicle, date) {
27972781 html = "<div style='line-height:16px;position:relative;'>" ;
27982782 html += "<div>" + data . serial + " <span style=''>(" + date + ")</span></div>" ;
27992783 html += "<hr style='margin:5px 0px'>" ;
2800- html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + roundNumber ( data . lat , 5 ) + ', ' + roundNumber ( data . lon , 5 ) + "</div>" ;
2784+ html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + format_coordinates ( data . lat , data . lon , data . serial ) + "</div>" ;
28012785
28022786 var imp = offline . get ( 'opt_imperial' ) ;
28032787 var text_alt = Number ( ( imp ) ? Math . floor ( 3.2808399 * parseInt ( data . alt ) ) : parseInt ( data . 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" +
@@ -4665,7 +4636,7 @@ function updateRecoveryMarker(recovery) {
46654636 html = "<div style='line-height:16px;position:relative;'>" ;
46664637 html += "<div><b>" + recovery . serial + ( recovery . recovered ? " Recovered" : " Not Recovered" ) + "</b></div>" ;
46674638 html += "<hr style='margin:5px 0px'>" ;
4668- html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + roundNumber ( recovery . lat , 5 ) + ', ' + roundNumber ( recovery . lon , 5 ) + "</div>" ;
4639+ html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i> </b>" + format_coordinates ( recovery . lat , recovery . lon , recovery . serial ) + "</div>" ;
46694640
46704641 var imp = offline . get ( 'opt_imperial' ) ;
46714642 var text_alt = Number ( ( imp ) ? Math . floor ( 3.2808399 * parseInt ( recovery . alt ) ) : parseInt ( recovery . alt ) ) . toLocaleString ( "us" ) ;
@@ -4777,7 +4748,7 @@ function updateRecoveryPane(r){
47774748
47784749 html += "<div style='line-height:16px;position:relative;'>" ;
47794750 html += "<div><b><u>" + r [ i ] . serial + ( r [ i ] . recovered ? " Recovered by " : " Not Recovered by " ) + r [ i ] . recovered_by + "</u></b></div>" ;
4780- html += "<div style='margin-bottom:5px;'><b><button style='margin-bottom:0px;' onclick='panToRecovery(\"" + r [ i ] . serial + "\")'><i class='icon-location'></i></button> </b>" + roundNumber ( lat , 5 ) + ', ' + roundNumber ( lon , 5 ) + "</div>" ;
4751+ html += "<div style='margin-bottom:5px;'><b><button style='margin-bottom:0px;' onclick='panToRecovery(\"" + r [ i ] . serial + "\")'><i class='icon-location'></i></button> </b>" + format_coordinates ( lat , lon , r [ i ] . serial ) + "</div>" ;
47814752
47824753 var imp = offline . get ( 'opt_imperial' ) ;
47834754 var text_alt = Number ( ( imp ) ? Math . floor ( 3.2808399 * parseInt ( alt ) ) : parseInt ( alt ) ) . toLocaleString ( "us" ) ;
0 commit comments