icaoFilter
This commit is contained in:
@@ -7,6 +7,7 @@ var UP_TRIANGLE='\u25b2'; // U+25B2 BLACK UP-POINTING TRIANGLE
|
||||
var DOWN_TRIANGLE='\u25bc'; // U+25BC BLACK DOWN-POINTING TRIANGLE
|
||||
|
||||
var TrackDirections = ["North","NE","East","SE","South","SW","West","NW"];
|
||||
var TrackDirectionArrows = ["\u21e7","\u2b00","\u21e8","\u2b02","\u21e9","\u2b03","\u21e6","\u2b01"];
|
||||
|
||||
var UnitLabels = {
|
||||
'altitude': { metric: "m", imperial: "ft", nautical: "ft"},
|
||||
@@ -44,6 +45,14 @@ function format_track_long(track) {
|
||||
var trackDir = Math.floor((360 + track % 360 + 22.5) / 45) % 8;
|
||||
return TrackDirections[trackDir] + ":" + NBSP + track.toFixed(1) + DEGREES;
|
||||
}
|
||||
function format_track_arrow(track) {
|
||||
if (track == null){
|
||||
return "";
|
||||
}
|
||||
|
||||
var trackDir = Math.floor((360 + track % 360 + 22.5) / 45) % 8;
|
||||
return TrackDirectionArrows[trackDir];
|
||||
}
|
||||
|
||||
// alt in feet
|
||||
function format_altitude_brief(alt, vr, displayUnits) {
|
||||
|
||||
@@ -95,10 +95,10 @@
|
||||
|
||||
<div class="highlightedTitle">
|
||||
<div>
|
||||
<span class="identLarge" title="Typically the air traffic control callsign or the aircraft's registration, as entered into the transponder by the pilot"><span id="selected_callsign">n/a</span></span>
|
||||
<span class="identLarge" title="Callsign: Typically the air traffic control callsign or the aircraft's registration, as entered into the transponder by the pilot"><span id="selected_callsign">n/a</span></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="identSmall" title="The aircraft's unique ICAO identification number shown in hexadecimal format"><span id="selected_icao">n/a</span></span>
|
||||
<span class="identSmall" title="ICAO / hex id: The aircraft's unique ICAO identification number shown in hexadecimal format"><span id="selected_icao">n/a</span></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -114,7 +114,7 @@
|
||||
</div>
|
||||
<div class="infoRowLine ">
|
||||
<div class="infoHeading infoRowFluid">
|
||||
<span title="The alphanumeric registration code assigned by the country in which the aircraft is registered.">Tailnr.: </span>
|
||||
<span title="Registration: The alphanumeric registration code assigned by the country in which the aircraft is registered.">Reg.: </span>
|
||||
</div>
|
||||
<div class="infoData infoRowFluid"><span id="selected_registration">n/a</span></div>
|
||||
</div>
|
||||
|
||||
@@ -306,6 +306,7 @@ PlaneObject.prototype.updateTrack = function(now, last, serverTrack) {
|
||||
alt_real: this.altitude,
|
||||
speed: this.speed,
|
||||
ts: now,
|
||||
track: this.rotation,
|
||||
};
|
||||
this.track_linesegs.push(newseg);
|
||||
this.history_size ++;
|
||||
@@ -410,6 +411,7 @@ PlaneObject.prototype.updateTrack = function(now, last, serverTrack) {
|
||||
alt_real: this.altitude,
|
||||
speed: this.speed,
|
||||
ts: now,
|
||||
track: this.rotation,
|
||||
};
|
||||
this.track_linesegs.push(newseg);
|
||||
this.history_size += 2;
|
||||
@@ -492,6 +494,7 @@ PlaneObject.prototype.updateTrack = function(now, last, serverTrack) {
|
||||
speed: this.prev_speed,
|
||||
ground: on_ground,
|
||||
ts: this.prev_time,
|
||||
track: this.prev_rot,
|
||||
});
|
||||
|
||||
this.history_size += 2;
|
||||
@@ -1402,7 +1405,8 @@ PlaneObject.prototype.updateLines = function() {
|
||||
NBSP + Number(seg.speed).toFixed(0).toString().padStart(3, NBSP) + " "
|
||||
+ (seg.alt_real == "ground" ? ("Ground" + NBSP) : (seg.alt_real.toString().padStart(6, NBSP) + NBSP))
|
||||
+ "\n"
|
||||
+ "".padStart(4, NBSP) + timestamp + "".padStart(4, NBSP)
|
||||
//+ NBSP + format_track_arrow(seg.track)
|
||||
+ "".padStart(3, NBSP) + timestamp + "".padStart(3, NBSP);
|
||||
seg.label.setStyle(
|
||||
new ol.style.Style({
|
||||
text: new ol.style.Text({
|
||||
|
||||
@@ -73,6 +73,7 @@ var lastReqestFiles = 0;
|
||||
var debugCounter = 0;
|
||||
var selectedPhotoCache = null;
|
||||
var pathName = null;
|
||||
var icaoFilter = null;
|
||||
|
||||
var SpecialSquawks = {
|
||||
'7500' : { cssClass: 'squawk7500', markerColor: 'rgb(255, 85, 85)', text: 'Aircraft Hijacking' },
|
||||
@@ -126,6 +127,8 @@ function processAircraft(ac, init, uat) {
|
||||
return;
|
||||
}
|
||||
*/
|
||||
if (icaoFilter && !icaoFilter.includes(hex))
|
||||
return;
|
||||
|
||||
plane = Planes[hex];
|
||||
|
||||
@@ -871,6 +874,10 @@ function parse_history() {
|
||||
// And kick off one refresh immediately.
|
||||
processURLParams();
|
||||
|
||||
|
||||
if (!icaoFilter && globeIndex)
|
||||
toggleTableInView(true);
|
||||
|
||||
fetchData();
|
||||
|
||||
updateMapSize();
|
||||
@@ -928,7 +935,6 @@ function initialize_map() {
|
||||
globeIndexGrid = receiverJson.globeIndexGrid;
|
||||
globeIndex = 1;
|
||||
globeIndexSpecialTiles = receiverJson.globeIndexSpecialTiles;
|
||||
toggleTableInView(true);
|
||||
$('#dump1090_total_history_td').hide();
|
||||
$('#dump1090_message_rate_td').hide();
|
||||
}
|
||||
@@ -1822,7 +1828,7 @@ function refreshTableInfo() {
|
||||
|
||||
tableplane.inView = inView(tableplane, lastRealExtent);
|
||||
|
||||
if (globeIndex) {
|
||||
if (globeIndex && !icaoFilter) {
|
||||
if (inView(tableplane, lastRenderExtent) || tableplane.selected) {
|
||||
tableplane.updateFeatures(now, last);
|
||||
} else if (tableplane.visible) {
|
||||
@@ -1830,8 +1836,7 @@ function refreshTableInfo() {
|
||||
tableplane.clearLines();
|
||||
tableplane.visible = false;
|
||||
}
|
||||
}
|
||||
if (!globeIndex) {
|
||||
} else {
|
||||
tableplane.updateTick();
|
||||
}
|
||||
|
||||
@@ -2652,7 +2657,7 @@ function followRandomPlane() {
|
||||
}
|
||||
|
||||
function toggleTableInView(switchOn) {
|
||||
if (switchOn || globeIndex) {
|
||||
if (switchOn || (globeIndex && !icaoFilter)) {
|
||||
tableInView = true;
|
||||
} else {
|
||||
tableInView = !tableInView;
|
||||
@@ -3025,6 +3030,11 @@ function highlight(evt) {
|
||||
function processURLParams(){
|
||||
try {
|
||||
const search = new URLSearchParams(window.location.search);
|
||||
|
||||
icaoFilter = search.get('icaoFilter');
|
||||
if (icaoFilter)
|
||||
icaoFilter = icaoFilter.toLowerCase().split(',');
|
||||
|
||||
const icao = search.get('icao');
|
||||
const callsign = search.get('callsign');
|
||||
var zoom;
|
||||
|
||||
Reference in New Issue
Block a user