heatmap: query option heatFilters
new heatmap query option: significant slowdown / experimental enable filtering by type code / type description / hex / DB flags / military / registration / country of registration / data source
This commit is contained in:
@@ -83,6 +83,7 @@ See the main readme for more examples on how to use the filters
|
||||
- heatAlpha - 0.1 to 1.0 - how transparent the dots will be
|
||||
- heatRadius - dot size for heatmap
|
||||
- heatManualRedraw - only redraw dots when pressing r
|
||||
- heatFilters - significant slowdown / experimental: enable filtering by type code / type description / hex / DB flags / military / registration / country of registration / data source
|
||||
|
||||
- realHeat - real heatmap instead of dots
|
||||
- heatBlur - parameter for realHeat
|
||||
|
||||
@@ -267,6 +267,8 @@ if (usp.has('heatmap') || usp.has('realHeat')) {
|
||||
heatmap.end -= tmp * 3600 * 1000;
|
||||
if (usp.has('heatLines'))
|
||||
heatmap.lines = true;
|
||||
if (usp.has('heatfilters'))
|
||||
heatmap.filters = true;
|
||||
tmp = parseFloat(usp.get('heatAlpha'));
|
||||
if (!isNaN(tmp)) {
|
||||
heatmap.alpha = tmp;
|
||||
|
||||
@@ -2796,7 +2796,7 @@ PlaneObject.prototype.checkForDB = function(data) {
|
||||
this.dbinfoLoaded = true;
|
||||
}
|
||||
}
|
||||
if (!this.dbinfoLoaded && (!dbServer || replay || pTracks)) {
|
||||
if (!this.dbinfoLoaded && (!dbServer || replay || pTracks || heatmap)) {
|
||||
this.getAircraftData();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7014,6 +7014,7 @@ function drawHeatmap() {
|
||||
}
|
||||
|
||||
let points = myPoints[k];
|
||||
let pointsU = new Uint32Array(points.buffer);
|
||||
|
||||
let i = 4 * indexes[k][offsets[k]];
|
||||
|
||||
@@ -7055,6 +7056,33 @@ function drawHeatmap() {
|
||||
if (PlaneFilter.enabled && altFiltered(alt))
|
||||
continue;
|
||||
|
||||
if (heatmap.filters) {
|
||||
let type = (pointsU[i] >> 27) & 0x1F;
|
||||
let dataSource;
|
||||
switch (type) {
|
||||
case 0: dataSource = 'adsb'; break;
|
||||
case 1: dataSource = 'modeS'; break;
|
||||
case 2: dataSource = 'adsr'; break;
|
||||
case 3: dataSource = 'tisb'; break;
|
||||
case 4: dataSource = 'adsc'; break;
|
||||
case 5: dataSource = 'mlat'; break;
|
||||
case 6: dataSource = 'other'; break;
|
||||
case 7: dataSource = 'modeS'; break;
|
||||
case 8: dataSource = 'adsb'; break;
|
||||
case 9: dataSource = 'adsr'; break;
|
||||
case 10: dataSource = 'tisb'; break;
|
||||
case 11: dataSource = 'tisb'; break;
|
||||
default: dataSource = 'unknown';
|
||||
}
|
||||
let hex = (pointsU[i] & 0xFFFFFF).toString(16).padStart(6, '0');
|
||||
hex = (pointsU[i] & 0x1000000) ? ('~' + hex) : hex;
|
||||
let plane = g.planes[hex] || new PlaneObject(hex);
|
||||
plane.dataSource = dataSource;
|
||||
if (plane.isFiltered()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
pointCount++;
|
||||
//console.log(pos);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user