diff --git a/README-query.md b/README-query.md index 25522fd..a74daa0 100644 --- a/README-query.md +++ b/README-query.md @@ -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 diff --git a/html/script.js b/html/script.js index bac7b60..92fb125 100644 --- a/html/script.js +++ b/html/script.js @@ -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();