fix default sorting

fixes: https://github.com/wiedehopf/tar1090/issues/199
This commit is contained in:
Matthias Wirth
2022-08-12 18:16:47 +02:00
parent 65938498a4
commit e35a3affb4
2 changed files with 13 additions and 3 deletions

View File

@@ -22,6 +22,8 @@
- filterIcao=^a - filter icao that start with a
- filterSources=adsb,uat,adsr,mlat,tisb,modeS - filter palnes by source type.
- filterDbFlag=military,pia,ladd - filter planes by the db flags.
- sortBy=column - (possible values: icao, flag, flight, registration, aircraft_type, squawk, altitude, speed, vert_rate, distance, track, msgs, seen, rssi, lat, lon, data_source, military, ws, wd
- sortByReverse - reverse the sorting specified using sortBy
See the main readme for more exapmles on how to use the filters
@@ -57,6 +59,7 @@ See the main readme for more exapmles on how to use the filters
- nowebgl - force rendering without WebGL.
- tableInView - button V / only show aircraft in view in the table
- screenshot - For automatic screenshotting, disables updates after the first load of all aircraft in view
- SiteLat=45.0 SiteLon=10.0 - Override the receiver location for this visit
## Toggles

View File

@@ -6317,8 +6317,8 @@ function geoFindMe() {
}
}
let initSitePosFirstRun = true;
function initSitePos() {
let lastSitePosition = SitePosition;
// Set SitePosition
if (SiteLat != null && SiteLon != null) {
SitePosition = [SiteLon, SiteLat];
@@ -6329,8 +6329,15 @@ function initSitePos() {
TAR.planeMan.setColumnVis('distance', false);
}
if (!lastSitePosition) {
if (SitePosition) {
if (initSitePosFirstRun && SitePosition) {
initSitePosFirstRun = false;
const sortBy = usp.get('sortBy');
if (sortBy) {
TAR.planeMan.cols[sortBy].sort();
if (usp.has('sortByReverse')) {
TAR.planeMan.cols[sortBy].sort();
}
} else if (SitePosition) {
TAR.planeMan.cols.distance.sort();
} else {
TAR.planeMan.cols.altitude.sort();