Skip to content

Commit a559d85

Browse files
author
Michaela
committed
Allow multiple callsign data in point lookuyp
1 parent a0b5d8f commit a559d85

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

js/tracker.js

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ var mapInfoBox_handle_path_fetch = function(id,vehicle) {
14731473
html += "<img style='position:absolute;top:"+vehicle.image_src_offset.y+"px;left:"+vehicle.image_src_offset.x+"px;" +
14741474
"width:"+vehicle.image_src_size.width+"px;height:"+vehicle.image_src_size.height+"px'" +
14751475
" src='"+vehicle.image_src+"' />";
1476-
html += "<div>"+data.vehicle+"<span style='position:absolute;right:0px;'>("+data.position_id+")</span></div>";
1476+
html += "<div>"+data.vehicle+"<span style=''>("+data.position_id+")</span></div>";
14771477
html += "<hr style='margin:5px 0px'>";
14781478
html += "<div style='margin-bottom:5px;'><b><i class='icon-location'></i>&nbsp;</b>"+roundNumber(data.gps_lat, 5) + ',&nbsp;' + roundNumber(data.gps_lon, 5)+"</div>";
14791479

@@ -1504,7 +1504,30 @@ var mapInfoBox_handle_path_fetch = function(id,vehicle) {
15041504

15051505
if(data.vehicle.search(/(chase)/i) == -1) {
15061506
html += "<hr style='margin:0px;margin-top:5px'>";
1507-
html += "<div style='font-size:11px;'><b>Received via:&nbsp;</b>"+data.callsign.replace(/,/g,', ')+"</div>";
1507+
html += "<div style='font-size:11px;'>"
1508+
var callsign_list = []
1509+
for(var rxcall in data.callsign){
1510+
if(data.callsign.hasOwnProperty(rxcall)) {
1511+
_new_call += "<b>Received via:&nbsp;</b> ";
1512+
_new_call = rxcall;
1513+
if(data.callsign[rxcall].hasOwnProperty('snr')){
1514+
if(data.callsign[rxcall].snr){
1515+
_new_call += " (" + data.callsign[rxcall].snr.toFixed(0) + " dB)";
1516+
callsign_list.push(_new_call)
1517+
continue;
1518+
}
1519+
}
1520+
if(data.callsign[rxcall].hasOwnProperty('rssi')){
1521+
if(data.callsign[rxcall].rssi){
1522+
_new_call += " (" + data.callsign[rxcall].snr.toFixed(0) + " dBm)";
1523+
callsign_list.push(_new_call)
1524+
continue;
1525+
}
1526+
}
1527+
}
1528+
}
1529+
callsign_list = callsign_list.join("<br /> ");
1530+
html += callsign_list + "</div>";
15081531
}
15091532

15101533
div.innerHTML = html;

0 commit comments

Comments
 (0)