diff --git a/dump1090.c b/dump1090.c index 7fa5327a3..3f032c8a2 100644 --- a/dump1090.c +++ b/dump1090.c @@ -2154,9 +2154,9 @@ char *aircraftsToJson(int *len) { l = snprintf(p,buflen, "{\"hex\":\"%s\", \"flight\":\"%s\", \"lat\":%f, " "\"lon\":%f, \"altitude\":%d, \"track\":%d, " - "\"speed\":%d},\n", - a->hexaddr, a->flight, a->lat, a->lon, a->altitude, a->track, - a->speed); + "\"speed\":%d, \"metric\":%d},\n", + a->hexaddr, a->flight, a->lat, a->lon, altitude, a->track, + speed, Modes.metric); p += l; buflen -= l; /* Resize if needed. */ if (buflen < 256) { diff --git a/gmap.html b/gmap.html index b39a30a22..229cf6559 100644 --- a/gmap.html +++ b/gmap.html @@ -90,8 +90,14 @@ if (p.flight.length) { html += ''+p.flight+'
'; } - html += 'Altitude: '+p.altitude+' feet
'; - html += 'Speed: '+p.speed+' knots
'; + if (p.metric) { + html += 'Altitude: '+p.altitude+' meters
'; + html += 'Speed: '+p.speed+' km/h
'; + } + else { + html += 'Altitude: '+p.altitude+' feet
'; + html += 'Speed: '+p.speed+' knots
'; + } html += 'Coordinates: '+p.lat+', '+p.lon+'
'; i.innerHTML = html; } @@ -118,6 +124,7 @@ myplane.lon = plane.lon; myplane.track = plane.track; myplane.flight = plane.flight; + myplane.metric = plane.metric; if (myplane.hex == Selected) refreshSelectedInfo(); } else {