Show rights units in web interface
This commit is contained in:
parent
6f3f2e205b
commit
f342094d16
@ -2154,9 +2154,9 @@ char *aircraftsToJson(int *len) {
|
|||||||
l = snprintf(p,buflen,
|
l = snprintf(p,buflen,
|
||||||
"{\"hex\":\"%s\", \"flight\":\"%s\", \"lat\":%f, "
|
"{\"hex\":\"%s\", \"flight\":\"%s\", \"lat\":%f, "
|
||||||
"\"lon\":%f, \"altitude\":%d, \"track\":%d, "
|
"\"lon\":%f, \"altitude\":%d, \"track\":%d, "
|
||||||
"\"speed\":%d},\n",
|
"\"speed\":%d, \"metric\":%d},\n",
|
||||||
a->hexaddr, a->flight, a->lat, a->lon, altitude, a->track,
|
a->hexaddr, a->flight, a->lat, a->lon, altitude, a->track,
|
||||||
speed);
|
speed, Modes.metric);
|
||||||
p += l; buflen -= l;
|
p += l; buflen -= l;
|
||||||
/* Resize if needed. */
|
/* Resize if needed. */
|
||||||
if (buflen < 256) {
|
if (buflen < 256) {
|
||||||
|
11
gmap.html
11
gmap.html
@ -90,8 +90,14 @@
|
|||||||
if (p.flight.length) {
|
if (p.flight.length) {
|
||||||
html += '<b>'+p.flight+'</b><br>';
|
html += '<b>'+p.flight+'</b><br>';
|
||||||
}
|
}
|
||||||
html += 'Altitude: '+p.altitude+' feet<br>';
|
if (p.metric) {
|
||||||
html += 'Speed: '+p.speed+' knots<br>';
|
html += 'Altitude: '+p.altitude+' meters<br>';
|
||||||
|
html += 'Speed: '+p.speed+' km/h<br>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html += 'Altitude: '+p.altitude+' feet<br>';
|
||||||
|
html += 'Speed: '+p.speed+' knots<br>';
|
||||||
|
}
|
||||||
html += 'Coordinates: '+p.lat+', '+p.lon+'<br>';
|
html += 'Coordinates: '+p.lat+', '+p.lon+'<br>';
|
||||||
i.innerHTML = html;
|
i.innerHTML = html;
|
||||||
}
|
}
|
||||||
@ -118,6 +124,7 @@
|
|||||||
myplane.lon = plane.lon;
|
myplane.lon = plane.lon;
|
||||||
myplane.track = plane.track;
|
myplane.track = plane.track;
|
||||||
myplane.flight = plane.flight;
|
myplane.flight = plane.flight;
|
||||||
|
myplane.metric = plane.metric;
|
||||||
if (myplane.hex == Selected)
|
if (myplane.hex == Selected)
|
||||||
refreshSelectedInfo();
|
refreshSelectedInfo();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user