Retain callsign even after it disappears from json.
This commit is contained in:
parent
c6d7f1ec6f
commit
4baae970ae
|
@ -432,7 +432,7 @@ PlaneObject.prototype.updateData = function(receiver_timestamp, data) {
|
|||
var fields = ["altitude", "alt_geom", "gs", "ias", "tas", "track",
|
||||
"track_rate", "mag_heading", "true_heading", "mach",
|
||||
"roll", "intent_alt", "intent_heading", "intent_modes",
|
||||
"alt_setting", "baro_rate", "geom_rate", "flight",
|
||||
"alt_setting", "baro_rate", "geom_rate",
|
||||
"squawk", "category", "version"];
|
||||
|
||||
for (var i = 0; i < fields.length; ++i) {
|
||||
|
@ -450,6 +450,10 @@ PlaneObject.prototype.updateData = function(receiver_timestamp, data) {
|
|||
else
|
||||
this.addrtype = 'adsb_icao';
|
||||
|
||||
// don't expire callsigns
|
||||
if ('flight' in data)
|
||||
this.flight = data.flight;
|
||||
|
||||
if ('lat' in data && 'lon' in data) {
|
||||
this.position = [data.lon, data.lat];
|
||||
this.last_position_time = receiver_timestamp - data.seen_pos;
|
||||
|
|
Loading…
Reference in a new issue