Skip to content

Commit a5c8b16

Browse files
prefix flight docid for habitat archieve payloads
1 parent 3042f07 commit a5c8b16

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

js/tracker.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2321,7 +2321,7 @@ function refreshPredictions() {
23212321
});
23222322
}
23232323

2324-
function habitat_translation_layer(json_result) {
2324+
function habitat_translation_layer(json_result, prefix) {
23252325
if(json_result.rows.length === 0) {
23262326
habitat_payload_step(true);
23272327
return;
@@ -2349,7 +2349,7 @@ function habitat_translation_layer(json_result) {
23492349

23502350
var row = {
23512351
'position_id': 0,
2352-
'vehicle': doc.data.payload,
2352+
'vehicle': prefix + doc.data.payload,
23532353
'server_time': doc.data._parsed.time_parsed,
23542354
'sequence': doc.data.sentence_id,
23552355
'gps_lat': doc.data.latitude,
@@ -2404,12 +2404,13 @@ function habitat_payload_step(remove_current) {
24042404
habitat_payload_step_data.idx += 1;
24052405
habitat_payload_step_data.idx = habitat_payload_step_data.idx % habitat_payload_step_data.payloads.length;
24062406

2407+
var prefix = habitat_payload_step_data.payloads[habitat_payload_step_data.idx].prefix;
24072408
var url = habitat_payload_step_data.payloads[habitat_payload_step_data.idx].url;
24082409
url += habitat_payload_step_data.payloads[habitat_payload_step_data.idx].skip;
24092410
habitat_payload_step_data.payloads[habitat_payload_step_data.idx].skip += habitat_max;
24102411

24112412
ajax_positions = $.getJSON(url, function(response) {
2412-
habitat_translation_layer(response);
2413+
habitat_translation_layer(response, prefix);
24132414
});
24142415
}
24152416

@@ -2451,6 +2452,7 @@ function habitat_doc_step(hab_docs) {
24512452
url = url.replace("{START}", ts_start).replace("{END}", ts_end);
24522453

24532454
habitat_payload_step_data.payloads.push({
2455+
prefix: response._id.substr(-4) + "/",
24542456
url: url,
24552457
skip: 0,
24562458
});

0 commit comments

Comments
 (0)